Categories:
Android (13)
Apple Mac (27)
DH Keys (39)
DSA Keys (83)
EC Keys (2483)
Firefox (39)
General (10)
Google Chrome (49)
Intermediate CA (152)
Java VM (29)
JDK Keytool (28)
Microsoft CertUtil (29)
Microsoft Edge (9)
Mozilla CertUtil (21)
OpenSSL (236)
Other (7)
Portecle (38)
Publishers (6653)
Revoked Certificates (16)
Root CA (85)
RSA Keys (5357)
Tools (46)
Tutorial (1)
What Is (22)
Windows (127)
Collections:
Other Resources:
Adding Trusted Certificates for Java on Windows
How to add a trusted CA (Certificate Authority) certificate into Java default keystore on Windows? My Java application failed because the server certificate is signed by a new CA.
✍: FYIcenter.com
If you are getting the "PKIX path building failed" error with this message: "sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target", and you decide to add the missing top certificate into Java default trusted keystore, you can try:
1. Use the "keytool -importcert" command to add the certificate in a command line window to the system level trusted certificate keystore "cacerts" file. See the command example below:
C:\Users\fyicenter>"\Program Files\java\jre7\bin\keytool" -importcert -keystore "\Program Files\java\jre7\lib\security\cacerts" -storepass changeit -file my_cert.pem -alias my_cert -noprompt
But if you don't have system admin permission, will get an error: "keytool error: java.io.FileNotFoundException: \Program Files\java\jre7\lib\security\cacerts (Access is denied)"
2. Use the "keytool -importcert" command to add the certificate in a command line window to the user level trusted certificate keystore "trusted.certs" file: See the command example below:
C:\Users\fyicenter>"\Program Files\java\jre7\bin\keytool" -importcert -keystore "\Users\fyicenter\AppData\LocalLow\sun\Java\Deployment\security \trusted.certs" -storepass "" -file my_cert.pem -alias my_cert -noprompt
If it works, you will see this messag: "Certificate was added to keystore".
3. Try "Java Control Panel" GUI tool, if you don't like the "keytool" command line. "Java Control Panel" is located in Windows "Control Panel" under the name "Java". Click "Security" tab, then "Certificates..." button, then "User" tab with "Trusted Certificates" selected.
⇒ System and User Level Keystore Files on Windows
⇐ SunCertPathBuilderException - Server Certificate Error
2022-03-06, 54085🔥, 4💬
Popular Posts:
What is the PKCS#1 v1.5 padding schema used in OpenSSL "rsautl" command? PKCS#1 v1.5 padding schema ...
Certificate summary - Owner: www.siteadvisor.com, McAfee Inc., Dmcafee, Dcom Issuer: NAI SSL CA v1, ...
Certificate Summary: Subject: Certum Domain Validation CA SHA2 Issuer: Certum Trusted Network CA Exp...
Why I am getting the "variable lookup failed for ca::serial" error when running OpenSSL "ca" command...
What is "Java Control Panel" on Windows computers? I heard that it's a nice tool. The Java Control P...