名词解释
KeyStore
密钥库是存储了密钥、证书链及受信任证书的数据库。
JAVA JDK 实现 生成keystore
Windows JDK bin 下开启terminal
keytool -genkeypair -alias "tomcat" -keyalg "RSA" -keystore "tomcat.keystore"
建议使用通用的PKCS12
Tomcat9 实现https 访问
此处端口为443
如果不删除<SSLHostConfig>直接追加,启动会报错:conf/server.xml: Error at (92, 25) : Multiple SSLHostConfig elements were provided for the host name [_default_]. Host names must be unique.
Tomcat9 强制http 跳转https
此处端口为8443
web.xml 添加如下的蓝色内容
这次改成了8443
重启tomcat
https://localhost:8443/ 正常访问
http://localhost:8080/ 跳转到 https://localhost:8443/ 正常访问
参考:
https://www.xingmal.com/article/article/1234419400786972672
https://www.cnblogs.com/zishengY/p/8474314.html
http://www.zhuwei.cc/html/article/20191203/20191203095238.html