简体   繁体   中英

Import Certificate and Private Key for Java

I am getting the following error from a Java Application ERROR: Naming service connection failed for https://******* com.iplanet.services.comm.client.SendRequestException: sun.security.validator.ValidatorException: PKIX path building failed:

I have been provided two files from who managed the target URL:

File.cer (should be a DER Encoded certificate) File.key (it's the private key)

I have then Read a lot from different site about what I need to do in order to import both into the JVM using tje keytool, ma still haven't understood how to do it correctly. Is there a procedure ?

You can import the certificate in your truststore with the following:

keytool -import -alias YOURALIAS -file File.cer -keystore YOURTRUSTSTORE.truststore -password YOURTRUSTSTOREPASSWORD

In your JVM arguments, please make sure you have -Djavax.net.ssl.trustStore= and -Djavax.net.ssl.trustStorePassword

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM