由于SunCertPathBuilderException:无法连接到Eclipse中的GitHub:未找到证书 [英] Unable to connect to GitHub within Eclipse due to SunCertPathBuilderException: certificate not found

查看:114
本文介绍了由于SunCertPathBuilderException:无法连接到Eclipse中的GitHub:未找到证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我安装了EGit和Github(Mylin)插件。我已经安装了我的Mac和Eclipse EE Luna,并且都可以正常工作(来自Windows)。不过,我似乎无法在Eclipse中克隆github项目。
当通过EGit(而不是gitHub插件)使用eclipse import时,并填写任何opensource github项目的Https uri时,Egit抱怨它无法连接并显示带有Uri等可能原因的项目符号列表等等。

当使用Eclipse Github插件导入github项目并让插件搜索时,我得到着名的可信认证错误:

 搜索存储库时出错:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到有效的证书路径到要求的目标

奇怪...我有一个默认的java 8安装。
我甚至将github pub cert添加到了sdk / jre / lib中的jssecert文件,但没有任何效果。
我没有启用代理,无论是在Eclipse还是系统中。



我可以通过git命令git clone [https repo uri] 。

如何解决这个问题?

解决方案


这应该是一条评论,但由于某些愚蠢的原因,我需要获得
的声望才能发表评论......


同样的问题在这里。



我的git服务器有一个自签名的证书。

证书名称(CN)与我用来连接它的主机名称相同。



我在.gitconfig中放置了配置属性http.sslVerify = false 。

当我尝试克隆(使用https)时,Eclipse连接到存储库,获取存储库信息,显示主分支,开始克隆(它显示进度条),接收对象,但最后抛出一个异常(下面的异常),并且不克隆存储库(参见下面的图片)。

这里可能存在一个bug,因为它可以读取存储库以获取其信息和文件,但无法完成整个过程。



环境:

  eclipse.buildId = 4.5.0.I20150320-0800 
java.version = 1.8.0_25
java.vendor = Oracle Corporation
BootLoader常量:OS = win32,ARCH = x86_64,WS = win32,NL = pt_BR
Framework参数: - 产品org.eclipse.epp.package.jee.product
命令行参数:-os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

例外:

  org。 eclipse.core.runtime.CoreException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到有效的认证路径,请求目标
,位于org.eclipse.egit .core.op.ConfigureGerritAfterCloneTask.execute(ConfigureGerritAfterCloneTask.java:89)
at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:161)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.executeCloneOperation(AbstractGitCloneWizard.java:442)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.access $ 2(AbstractGitCloneWizard.java:435)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard $ 5.run(AbstractGitCloneWizard。 java:396)
at org.eclipse.jface.operation.ModalContext $ ModalContextThread.run(ModalContext.java:119)
引起:javax.net.ssl.SSLHandshakeException:sun.security.validator。 ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:在sun.security.ssl.Alerts.getSSLException(Alerts.java:192)$ b $无法找到有效的证书路径以请求目标
b在sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1917)
在sun.security.ssl.Handshaker.fatalSE(Handshaker.java:301)
在sun.security。 ssl.Handshaker.fatalSE(Handshaker.java:295)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1471)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker。 java:212)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:936)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:871)
在sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1043)
在sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
在sun.security.ssl.SSLSocketImpl .startHandshake(SSLSocketImpl.java:1371)
在sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)在sun.net.www.protocol.https.HttpsClient.afterConnect
(HttpsClient .java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpU RLConnection.java:1511)在sun.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLConnection.java:1439)
在java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at org.eclipse.egit.core.op.ConfigureGerritAfterCloneTask.isGerrit(ConfigureGerritAfterCloneTask.java:138)在org.eclipse.egit.core.op.ConfigureGerritAfterCloneTask.execute(ConfigureGerritAfterCloneTask.java:83)

... 5个
引起的:sun.security.validator.ValidatorException:PKIX路径建立失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到有效的证书路径到要求的目标
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
在太阳.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Val $ x $ at at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
。在sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
在sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1453)
... 20多个
由:sun.security.provider.certpath.SunCertPathBuilderException导致:无法找到有效的证书路径到要求的目标
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:145)
。在sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)
在java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
在sun.security .validator.PKIXValidator.doBuild(PKIXValidator.java:382)
... 26 more









I have setup my mac with Eclipse EE Luna and all seem to work fine (coming from Windows).

I installed EGit and the Github (Mylin) plugin.

However, I can't seem to clone a github project in Eclipse. When using the eclipse import through EGit (not the gitHub plugin), and fill in the Https uri (of any opensource github project), Egit complaints it can't connect and shows a bullet list with possible causes like Uri incorrect, etc..

When using the Eclipse Github plugin to import a github project and let the plugin search I get the famous trusted certification error:

Error searching repositories: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Strange... I have a default java 8 installation. I even added the github pub cert to the jssecert file in the sdk/jre/lib, but had no effect. I have no proxy enabled, neither in Eclipse or system.

I am able to clone a repo through the git command "git clone [https repo uri]".

How to solve this?

解决方案

This should be a comment, but for some stupid reason i need to have a reputation to make a comment...

Same problem here.

My git server have a self-signed certificate.

The certificate name (CN) have the same name as the hostname i use to connect to it.

I had put the configuration property "http.sslVerify=false" in .gitconfig.

When i try to clone (using https), Eclipse connects to the repository, gets the repository information, shows the "master" branch, starts to clone (it shows the progress bar), receive the objects, but throws an Exception at the end (exception below), and didn't clone the repository (see the images below).

There is probably a bug here, since it can read the repository to get its information and files, but cannot finish the whole process.

Environment:

eclipse.buildId=4.5.0.I20150320-0800
java.version=1.8.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

Exception:

org.eclipse.core.runtime.CoreException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at org.eclipse.egit.core.op.ConfigureGerritAfterCloneTask.execute(ConfigureGerritAfterCloneTask.java:89)
    at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:161)
    at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.executeCloneOperation(AbstractGitCloneWizard.java:442)
    at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.access$2(AbstractGitCloneWizard.java:435)
    at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard$5.run(AbstractGitCloneWizard.java:396)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1917)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:301)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:295)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1471)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:936)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:871)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1043)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at org.eclipse.egit.core.op.ConfigureGerritAfterCloneTask.isGerrit(ConfigureGerritAfterCloneTask.java:138)
    at org.eclipse.egit.core.op.ConfigureGerritAfterCloneTask.execute(ConfigureGerritAfterCloneTask.java:83)
    ... 5 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1453)
    ... 20 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:145)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
    ... 26 more

这篇关于由于SunCertPathBuilderException:无法连接到Eclipse中的GitHub:未找到证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆