The examples in this article all use jdk as the initial data.
1: Import certificate
1. Open the doc window, open cmd, and execute the command:
keytool -import -file f:\ca.crt -keystore "%JAVA_HOME %\jre\lib\security\cacerts" -alias server
-file Specifies the location of the certificate file
-alias Specifies the alias of the certificate
2. Enter the keystore Password:
changeit
3. Do you trust this certificate? [No]:
2: Verify whether the certificate is imported
keytool -list -keystore " %JAVA_HOME%\jre\lib\security\cacerts"| findstr /i server
server is the certificate alias specified above
keytool -import -alias cacerts -keystore D:\jdk1.5 \jre\lib\security\cacerts -file union-https.cer -trustcacerts
keytool -import -v -trustcacerts -alias union -file union-https.cer -storepass changeit -keystore "cacerts"
Related recommendations:
jdk connection mysql test_MySQL
The above is the detailed content of How to make JDK import certificate. For more information, please follow other related articles on the PHP Chinese website!