0

I've configured TeamCity e-mail notification to use Secure connection SSL. All parameters - host, port, login/pwd specified. Same parameters work for SVN e-mail notification, so it's not a problem. During connection test, TeamCity says:

javax.mail.MessagingException: Could not connect to SMTP host: XXX, port: YYY;
nested exception is:
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

What should I do to fix this error?

Nikita
  • 6,270
  • 2
  • 24
  • 37

1 Answers1

2

The problem was caused by missed certificate. Here is the steps how to fix it:

1) Get the client certificate from your mail server. Here is the instruction how to do it. Copy all the stuff between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- and save it into email.cer file. Footer and header should be also copied.

2) Download Portecle tool.

3) Go to your TeamCity folder\jre\bin and run from there:

 java -jar D:\portecle\portecle.jar

4) In Portecle tool open keystore at TeamCity folder\jre\lib\security\cacerts. It will ask the password, default is changeit.

5) Import your email.cer and save changes.

6) Restart your Team City server.

Community
  • 1
  • 1
Nikita
  • 6,270
  • 2
  • 24
  • 37
  • There doesn't seem to be a jre directory within the TeamCity Server docker container. Any idea how to configure this certificate store within the docker container? – Wesley Bunton Feb 26 '21 at 23:30