Team City Build Agent Start javax.net.ssl.SSLHandshakeException: PKIX path building failed Error

Hi,

After installing the build agent I have tried to start the service by running command prompt in the /bin folder and using agent.bat start

However I get the following message:

Starting TeamCity Build Agent Launcher...
Agent home directory is C:\TeamCity\buildAgent
[2024-02-29 11:11:31,268]   WARN - buildServer.AGENT.registration - Error while asking server for the communication protocols via URL https://f4g-dev.ffl.local:4441/app/agents/protocols. Will try later: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (enable debug to see stacktrace)

 

I have uploaded the correct SSL certificate in TC settings and also have tried adding it to the JRE by keytool -import but still no luck.

Any ideas? Am I missing another step?

0
3 comments
Hi Zack,

This error usually happens when the certificate was not added, or was added incorrectly. As you mentioned that you've already added the certificate, make sure of the following:
1. The certificate was added to the correct JRE (JRE used by the TeamCity build agent and server).
2. The JVM was restarted after the certificate was added or the machine was rebooted.

Could you also let me know the exact command you have used to add the certificate and to which JRE (i.e., the path to keytool command)? You can get it by executing "gcm keytool" in PowerShell.

Best regards,
Anton
0

Hi,

Solved now - I only added it to the TC Build Agent JRE and not the TC Server JRE

 

Thanks

0
Dear Zack,

Great! Thanks for confirming!

Best regards,
Anton
0

Please sign in to leave a comment.