1,今日JDK目录,执行命令
keytool -genkeypair -alias "tomcat" -keyalg "RSA" -keystore "D:guanghe.keystore"
会提示输入设置密码什么的,记住设置的密码即可,实验设置的密码为guanghe
2,在tomcat/conf/server.xml中添加一个Connector
<Connector port="8081" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="D:guanghe.keystore" keystorePass="guanghe" />
3,登陆浏览器访问
访问8080--》显示默认的http
访问8081--》显示https