How do I import a new Java CA cert without using the keytool command line utility?

后端 未结 6 1705
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 04:50

Executive summary: how do I install a new root certificate into Java using Java code?

We have a desktop application which accesses various web services. Recently one

6条回答
  •  北海茫月
    2021-01-12 05:13

    Sun published this code to create an updated version of your cacerts file based on any target host running https with any certs:

    https://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java

    Your new cacerts will be named jssecacerts in the current directory. Just copy that new file over your jre/lib/security/cacerts file.

    I make no comment about the security of your new cacerts file.

提交回复
热议问题