97

.truststore ファイルを処理する必要がある場所に出くわした人はいますか? .cer を .truststore ファイルにインポートする方法を知っていますか?

Java Keytool または Linux コマンド (openssl コマンドなど) を使用する必要があるかどうかはわかりません。

ありがとう

4

3 に答える 3

208
# Copy the certificate into the directory Java_home\Jre\Lib\Security
# Change your directory to Java_home\Jre\Lib\Security>
# Import the certificate to a trust store.

keytool -import -alias ca -file somecert.cer -keystore cacerts -storepass changeit [Return]

Trust this certificate: [Yes]

changeit はデフォルトのトラストストアのパスワードです

于 2008-12-17T00:42:22.957 に答える
26

sedを使用して証明書を除外する代わりに、次の例のようにopenssl s_client出力をにパイプすることもできます。openssl x509 -out certfile.txt

echo "" | openssl s_client -connect my.server.com:443 -showcerts 2>/dev/null | openssl x509 -out certfile.txt
于 2012-05-23T20:34:44.917 に答える