user968880
user968880

Reputation: 645

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

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.

Upvotes: 4

Views: 78378

Answers (3)

razvang
razvang

Reputation: 1285

I have groovy script, and I was using @Grab(group='org.apache.commons', module='commons-collections4', version='4.2')

I could not runt it because of an error Error grabbing Grapes -- [unresolved dependency: org.apache.commons#commons-collections4;4.2: not found]

Using -Divy.message.logger.level=4 I saw I was having the following problem:

Server access error at url https://repo1.maven.org/maven2/org/apache/commons/commons-collections4/4.2/commons-collections4-4.2.pom (javax.net.ssl.SSLException: Received fatal alert: protocol_version)

My qick fix was to use JDK8 instead of JDK7 it seems that JDK8 has updated certificates and it worked

Upvotes: 1

kunal
kunal

Reputation: 779

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:

Upvotes: 5

user3233042
user3233042

Reputation: 39

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

Upvotes: 2

Related Questions