为Apache创建自签名证书

・1 分钟阅读

为Apache Tomcat创建自签名证书

${JAVA_HOME}/bin/keytool -genkey -alias tomcat [-validity (# of days valid)] -keyalg RSA -keystore (Path to keystore)
必须以root运行,'tomcat '用户必须有权访问.keystore文件。密钥和密钥库密码必须相同。必须将密码输入到Tomcat的server.xml配置文件中,
示例输出
Enter keystore password: 
What is your first and last name? [Unknown]:
What is the name of your organizational unit? [Unknown]: 
What is the name of your organization? [Unknown]: 
What is the name of your City or Locality? [Unknown]: 
What is the name of your State or Province? [Unknown]: 
What is the two-letter country code for this unit? [Unknown]: 
Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct? [no]: yes
Enter key password for <tomcat>
 (RETURN if same as keystore password): 
讨论
Hujiuxiang profile image