unable to find valid certification path to requested target

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

or

unable to find valid certification path to requested target


This error is from your end (client side), not from server-side, you might have forgotten to import the Keystore or you are not able to import the cert to jvm truststore (cacerts) due to admin access restrictions to Program Files and Java directory.

How to fix this issue:

just import cert into temp Truststore file

you can refer the newly created cacerts from the new folder as below.

you can download the .cer file from the site that you are trying to connect, click on the secure lock symbol to download the .cer file.

make sure your .cer file is valid using below command

keytool -printcert -file "C:\certs\myblog_cert.cer"


generate Truststore using below command to create temp_cacerts file

JAVA_HOME/bin/keytool -import -file "C:\certs\myblog_cert.cer" -keystore "C:\certs\temp_cacerts" -alias blog.doosarisaikiran.com

now use the below file as your Truststore

C:\certs\temp_cacerts


Note :

use it at your own risk, this is only for the local environment, i am not an expert in SSL. i am still learning.