查看openssl的版本:
第二步,用CA去签发tomcat
- # keytool -genkey -alias tomcat_server -validity 365 -keyalg RSA -keysize 1024 -keystore server_keystore
- //Enter keystore password:123456
- //Re-enter new password:123456
- //What is your first and last name?
- // [Unknown]: 192.168.1.211
- //What is the name of your organizational unit?
- // [Unknown]: SoftWare
- //What is the name of your organization?
- // [Unknown]: Delochi
- //What is the name of your City or Locality?
- // [Unknown]: Kun Ming
- //What is the name of your State or Province?
- // [Unknown]: Yun Nan
- //What is the two-letter country code for this unit?
- // [Unknown]: CN
- //Is CN=192.168.1.211, OU=SoftWare, O=Delochi, L=Kun Ming, ST=Yun Nan, C=CN correct?
- // [no]: y
- //Enter key password for <tomcat_server>
- // (RETURN if same as keystore password):123456
- //Re-enter new password:123456
- # keytool -certreq -alias tomcat_server -sigalg MD5withRSA -file server.csr -keystore server_keystore
- //Enter keystore password:123456
- # openssl x509 -req -in server.csr -out server-cert.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -days 365
- //Signature ok
- //subject=/C=CN/ST=Yun Nan/L=Kun Ming/O=Delochi/OU=SoftWare/CN=192.168.1.211
- //Getting CA Private Key
- # keytool -import -v -trustcacerts -alias tomcat_server -file server-cert.pem -keystore server_keystore
- //Enter keystore password: 123456
- //Certificate reply was installed in keystore
- //[Storing server_keystore]
