- 報錯:cannot open git-upload-pack
第一次經過eclipse導入github 項目,按照百度步驟進行操做,發現不能鏈接 github,cannot open git-upload-pack。java
- 報錯緣由
經過 eclipse 日誌排查報錯
!MESSAGE https://github.com/making/spring-boot-jersey-blank.git: cannot open git-upload-pack !STACK 0 org.eclipse.jgit.api.errors.TransportException: https://github.com/making/spring-boot-jersey-blank.git: cannot open git-upload-pack at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:196) at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:99) at org.eclipse.egit.ui.internal.clone.SourceBranchPage$8.run(SourceBranchPage.java:324) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/making/spring-boot-jersey-blank.git: cannot open git-upload-pack at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:499) at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:308) at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:175) ... 3 more Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version at sun.security.ssl.Alerts.getSSLException(Unknown Source) at sun.security.ssl.Alerts.getSSLException(Unknown Source) at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source) at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source) at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:167) at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:462) ... 5 more
重點在於 : javax.net.ssl.SSLException: Received fatal alert: protocol_version , ssl 協議版本存在問題。
在 github 的 Weak cryptographic standards removal notice 中有提到,取消TLSv1
/TLSv1.1 的鏈接方式,對於jdk1.7 的用戶能夠顯示的進行配置,對於jdk1.6 的客戶建議升級jdk版本,jdk1.8及以上版本支出 TLSV1.2,故不用配置。
git - 解決方法
我本地是1.7 須要進行相關的配置操做。
操做: 在 eclipse.ini 文件的最後加上 -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2(另起一行)