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

We are trying to get TeamCity to connect to a local git repository with a self-signed certificate, and we are getting the following error:

List remote refs failed: 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

We have scoured Google looking for a solution.  We have tried OS global environemtn variable TEAMCITY_SERVER_OPTS=-Dcom.sun.net.ssl.checkRevocation=false, \bin\setenv.bat with the same, and beyond.

Any ideas how we can get TeamCity flowing with a self-signed certificate?  Any help with this would be much appreciated.

2 comments
Comment actions Permalink

Hi Devi,

Sorry for delay. Is the issue still actual?
You should add the certificate to Java keystore and supply the keystore to the JVM used by the connecting process.The steps that should be performed are:
1. import the certificate into a trustStore, to do that run the command:
keytool -import -file <path to your ssl certificate> -alias <alias for the certificate> -keystore <trustStore>
2. specify a trustStore for TeamCity, for example you can do that by changing options of TeamCity server:
TEAMCITY_SERVER_OPTS="$TEAMCITY_SERVER_OPTS -Djavax.net.ssl.trustStore=/path/to/trustStore -Djavax.net.ssl.trustStorePassword=<trustStore password>"
3. Restart the TeamCity server so that changes are taken into account

For more details please see: https://confluence.jetbrains.com/display/TCD9/Using+HTTPS+to+access+TeamCity+server#UsingHTTPStoaccessTeamCityserver-ConfiguringJVMforauthenticationwithclientcertificate.

0
Comment actions Permalink

I am tried to setup GitHub in 2017 TeamCity version .As per the documentation, it suggests no need of SSL as we are using GitHub so by providing username and password I should be able to connect to GitHub.

I even tried the import the GitHub certificate and added in the TeamCity server even that does not work for me .can you suggest I am not sure what is the workaround for such simple issues.

 

0

Please sign in to leave a comment.