I was running into a certificate related error when launching a clojure REPL with lein repl.
The error message reads
"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
for multiple maven and clojar repos.
Solution was to manually add the certificates for these websites to the java keystore.
In this specific scenario with running Lein REPL, I had to download the certificates for the following website and add them manually to the keystore
and
Steps to download the certificate
Navigate to the website
click on the lock icon to view the certificate ( this is chrome)
Click on Certificate
Select the Details tab
click on the copy to file option
Follow the wizard to save the .cer file to your local folder.
Make sure you select the .CER file option when saving the certificate.
Using the Java Keytool to add the certificate to the Java Keystore
run the following command to install the certificate into the Java Key store
keytool -importcert -file mavenrepo.cer -keystore C:\devtools\openjdk-13.0.2_windows-x64_bin\jdk-13.0.2\lib\security\cacerts -alias "mavenrepo"
NOTE
mavenrepo.cer is the certificate downloaded for the maven repo
The keystore being updated is the cacerts keystore found in the JDK folder referenced above
If the certificate is successfully added to the keystore you can open a new console and run lein repl.
No comments:
Post a Comment