读书人

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

发布时间: 2013-11-08 17:51:56 作者: rapoo

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"/>

读书人网 >Web前端

热点推荐