Hello together,
i tried using eclipse with egit/jgit to communicate with our remote repository. If i use git on command line it works as designed after adding the certificate to the bundle like recommended here:
h_t_t_p_s://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/
My .gitconfig looks like:
[user]
name = My Name
email = My E-Mail
[http]
sslCAInfo = C:/users/myuser/ca-bundle.crt
sslVerify = true
Of course it is working as well if i set:
But this is a workaround and not a solution cause we have a valid certificate from a valid coorperatewide ca.
The error:
h_t_t_p_s://git.company.local/myuser/scripts.git: cannot open git-upload-pack
Stack trace:
org.eclipse.jgit.api.errors.TransportException: h_t_t_p_s://git.company.local/myuser/scripts.git: cannot open git-upload-pack
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:245)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:288)
at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:200)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:232)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:176)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.access$0(PullOperationUI.java:168)
at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.runInWorkspace(PullOperationUI.java:141)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: org.eclipse.jgit.errors.TransportException: h_t_t_p_s://git.company.local/myuser/scripts.git: cannot open git-upload-pack
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:566)
at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:326)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1236)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:234)
... 10 more
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(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(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.h_t_t_p_s.h_t_t_p_sClient.afterConnect(Unknown Source)
at sun.net.www.protocol.h_t_t_p_s.AbstractDelegateh_t_t_p_sURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.h_t_t_p_s.h_t_t_p_sURLConnectionImpl.getResponseCode(Unknown Source)
at org.eclipse.jgit.transport.http.JDKHttpConnection.getResponseCode(JDKHttpConnection.java:99)
at org.eclipse.jgit.util.h_t_t_p_support.response(h_t_t_p_support.java:202)
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:504)
... 15 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(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 32 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 38 more
Session Data:
eclipse.buildId=4.7.1.M20171009-0410
java.version=1.8.0_151
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
Plugins:
Git integration for Eclipse 4.9.2.201712150930-r org.eclipse.egit.feature.group Eclipse EGit
Git integration for Eclipse - Task focused interface 4.9.2.201712150930-r org.eclipse.egit.mylyn.feature.group Eclipse EGit
Java implementation of Git 4.9.2.201712150930-r org.eclipse.jgit.feature.group Eclipse JGit
Mylyn Versions Connector: Git 1.15.0.v20170411-2003 org.eclipse.mylyn.git.feature.group Eclipse Mylyn
Git Version:
C:\versionsverwaltung\git_scripts>git version
git version 2.15.1.windows.2