当前位置: 代码迷 >> Web前端 >> tomcat5.5支持https(生成key时1定要填名字)
  详细解决方案

tomcat5.5支持https(生成key时1定要填名字)

热度:305   发布时间:2013-11-08 17:51:56.0
tomcat5.5支持https(生成key时一定要填名字)

keytool -genkey -alias tomcat -keyalg RSA
密码是:changeit
姓名是:localhost(此次一定要填,否则无法访问)

?

修改Tomcat server.xml 配置

<Connector port="8443" maxHttpHeaderSize="8192"
?????????????? maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
?????????????? enableLookups="true" disableUploadTimeout="true"
?????????????? acceptCount="100" scheme="https" secure="true"
?????????????? keystoreFile=".keystore" keystorePass="changeit"
?????????????? clientAuth="false" sslProtocol="TLS" />

?

访问:https://localhost:8443/?即可

?

tomcat7.x有所不同:

?

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
?????????????? maxThreads="150" scheme="https" secure="true"
?????????????? clientAuth="false" sslProtocol="TLS"
?????????????? keystoreFile=".keystore" keystorePass="111111"/>

  相关解决方案