I am facing this problem with PKIX path build failuer, this is what I have tried...
I went to the target URL that I am trying to reach
(eg -> https://localdevchannel.master.info/Gate/CustomerManagement/rest/resources/search)
I clicked on the "LOCK" icon and exported the certificate.
I ran below command...
keytool -importcert -file sec.cer -storepass changeit -keystore "C:/Program Files/Java/jdk-11.0.2/jdk-11.0.2/lib/security/cacerts" -alias secCert
The certificate got placed successfully. But I am still facing this issue. Please help what did I do wrong?
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I found this solution after I went true all the answers, and no one helped. I don't know why, but I change myprive.key and myepublic.crt just change to myprivate.key.pem and mypublic.pem
So just find out how to covert .key and .crt into .pem
After that, it workde perfectly.
I needed it for sonarqube and some QA tests