Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve sun.security.provider.certpath.SunCertPathBuilderException?

Tags:

java

I have written some code to connect to my mail server and read emails. I am using POP3 using SSL connection. I have also added SSL certificate to the java keystore. But still i am getting the same exception. Please help. Thanks in advance.

like image 752
user968880 Avatar asked Feb 23 '23 18:02

user968880


2 Answers

Possible cause this exception would be the cert from the keystore does not match the cert from the server.

Checkout these link might be helpful to you:

  • Unable to Connect to SSL Services due to PKIX Path Building Failed sun.security.provider.certpath.SunCertPathBuilderException
  • How to handle invalid SSL certificates with Apache HttpClient?
like image 152
kunal Avatar answered Feb 25 '23 06:02

kunal


I got the same error, I disabled always scan encrypted connections in the settings of my antivirus software, and it worked.

like image 38
user3233042 Avatar answered Feb 25 '23 07:02

user3233042