Multiple entries after storing one single certificate into my Java keystore -
i'm using class installcert import vmware vcenter certificate local java keystore.
the line socket.starthandshake()
returns unsupportedoperationexception
, class savingtrustmanager
still has downloaded certificate successfully.
then store downloaded certificate local keystore using following snippet.
keystore jsk; ... ... .. jks.setcertificateentry(alias, cert); outputstream out = new fileoutputstream("jssecacert"); jks.store(out, passphrase); out.close();
but when try list entries in keystore: keytool -list -keystore jssecacerts -v
, shows there 160 entries including 1 have downloaded.
i'm pretty sure keystore generated code, , supposed empty. i'd know other 159 entries come ?
thanks.
use keystoreexplorer comparing both truststores: jssecacerts generated installcert class, , cacerts file located en java>jre>security>lib.
istallcert takes certificate server , creates copy of truststore of jvm using. adds certificate copy of truststore, , names "jssecacerts". check piece of code:
file file = new file("jssecacerts"); if (file.isfile() == false) { char sep = file.separatorchar; file dir = new file(system.getproperty("java.home") + sep + "lib" + sep + "security"); file = new file(dir, "jssecacerts"); if (file.isfile() == false) { file = new file(dir, "cacerts"); } }
you need rename jsscacerts cacerts , replace original 1 on jvm
Comments
Post a Comment