Using p12 file without password in Java

Try it as I could, I can’t figure out how to use a .p12 file without a password in Java. I tried installing javax.net.ssl.keyStorePasswordon "", but all I do is getting the following SSL error:

HTTP transport error: javax.net.ssl.SSLHandshakeException: remote connection to a closed host during a handshake

All my searches suggest that the sun implementation will not allow an empty password, and, of course, keytool will not allow you to import any certificate without a password for the repository.

+4
source share
1 answer

, API Sun , .p12.

, openssl, .p12 .pem, .p12 ( ):

open­ssl pkcs12 -in cert.p12 -out temp.pem -passin pass: -passout pass:temppassword
open­ssl pkcs12 -export -in temp.pem -out cert-final.p12 -passin pass:temppassword -passout pass:newpa­ssword
rm -f temp.pem

. .

+3

All Articles