标签:http java 使用 io strong 文件 for new
生成 key
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
# $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  YourName
What is the name of your organizational unit?
  [Unknown]:  YourOrgUnit
What is the name of your organization?
  [Unknown]:  YourOrg
What is the name of your City or Locality?
  [Unknown]:  YourCity
What is the name of your State or Province?
  [Unknown]:  YourState
What is the two-letter country code for this unit?
  [Unknown]:  CN
Is CN=YourName, OU=YourOrgUnit, O=YourOrg, L=YourCity, ST=YourState, C=CN correct?
  [no]:  yes
Enter key password for <tomcat>
        (RETURN if same as keystore password):  
Re-enter new password: 特别说明:上边输入的“ 的主密码”,与 keystore 密码一定要相同,否则TOMCAT起不来
然后将生成的 .keystore 文件 copy 到 $CATALINA_BASE/conf 目录
编辑 $CATALINA_BASE/conf/server.xml
打开下面的配置
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="./conf/.keystore" keystorePass="password"
               /> 
  启动 Tomcat
Tomcat 启用 Https,布布扣,bubuko.com
标签:http java 使用 io strong 文件 for new
原文地址:http://my.oschina.net/sub/blog/305230