unable to find a valid certification path to requested target

We Are Going To Discuss About unable to find a valid certification path to requested target. So lets Start this Java Article.

unable to find a valid certification path to requested target

Advertisements
  1. We Are Going To Discuss About unable to find a valid certification path to requested target. So lets Start this Java Article.

    You can easily retrieve the Root CA certificate by visiting the server site in the browser. Click on the secure lock pad in the url bar and explore the certificate option. You need to export the Root CA certificate by using the copy option and save the cert file on your system.

  2. unable to find a valid certification path to requested target. So lets Start this Java Article.

    You can easily retrieve the Root CA certificate by visiting the server site in the browser. Click on the secure lock pad in the url bar and explore the certificate option. You need to export the Root CA certificate by using the copy option and save the cert file on your system.

Solution 1

Advertisements

As you are making an https connection from the client to the server. It is failing in the handshake process because the client needs to validate the server certificate. On the client-side, you need the issuer certificate (Root CA) to validate the server certificate. Most of the root certificates are pre-exists in JDK. Root certificates are stored, by default, in a Keystore file called cacerts. Here the server certificate is not issued by the certification authority and the server is either using the self-signed certificate or certificate issued by in house CA. You need to add the Root CA certificate to the java cacerts key store.

You can easily retrieve the Root CA certificate by visiting the server site in the browser. Click on the secure lock pad in the url bar and explore the certificate option. You need to export the Root CA certificate by using the copy option and save the cert file on your system.

Go to the location eg: C:\Program Files\Java\jdk1.8.0_121\jre\lib\security where the cacerts is present and open the command prompt to execute the following command.

keytool -import -alias -aliasName -file pathToRootCA.crt -keystore cacerts

Password is changeit

Original Author Of This Content

Conclusion

Advertisements

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Advertisements
Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment