egit報錯:cannot open git-upload-pack



  1.  第一次通過eclipse導入github 項目,按照百度步驟進行操作,發現不能連接 github,cannot open git-upload-pack。

    技術分享圖片

    技術分享圖片

     

    1. 報錯原因
      通過 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,故不用配置。

    2. 解決方法
      我本地是1.7 需要進行相關的配置操作。
      操作: 在 eclipse.ini 文件的最后加上 -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2(另起一行)
      技術分享圖片


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM