1.为服务器生成证书
keytool -genkey -v -alias tomcat -keyalg RSA -keystore E:\tomcat.keystore
CN=192.168.1.100, OU=snc, O=sms, L=nj, ST=js, C=cn
2.为客户端生成证书
keytool -genkey -v -alias myKey -keyalg RSA -storetype PKCS12 -keystore my.p12 -dname
"CN=192.168.1.100,OU=snc,O=sms,L=nj,ST=js,C=cn" -storepass password1 -keypass password2
3.让服务器信任客户端证书
keytool -export -alias myKey -keystore my.p12 -storetype PKCS12 -storepass password1 -rfc -file my.cer
keytool -import -v -file my.cer -keystore E:\tomcat.keystore -storepass 123456
keytool -genkey -v -alias tomcat -keyalg RSA -keystore E:\tomcat.keystore
CN=192.168.1.100, OU=snc, O=sms, L=nj, ST=js, C=cn
2.为客户端生成证书
keytool -genkey -v -alias myKey -keyalg RSA -storetype PKCS12 -keystore my.p12 -dname
"CN=192.168.1.100,OU=snc,O=sms,L=nj,ST=js,C=cn" -storepass password1 -keypass password2
3.让服务器信任客户端证书
keytool -export -alias myKey -keystore my.p12 -storetype PKCS12 -storepass password1 -rfc -file my.cer
keytool -import -v -file my.cer -keystore E:\tomcat.keystore -storepass 123456