2.tomcat 配置keytool 证书

1.生成证书文件

C:\Program Files\Java\jdk1.8.0_151\bin  目录执行:

生成秘钥文件。

#keytool -genkey -alias tomcat -keyalg RSA -keystore d:\tomcattest.keystore

密码、名字等

#创建证书文件

keytool -genkey -alias tomcat -keyalg RSA -keystore d:\tomcattest.keystore

C:\Program Files\Java\jdk1.8.0_151\bin 目录生成 tomcat.cer

2.配置tomcat(设置密码,秘钥位置)

注意443端口要未被占用,这里用其他端口也可以.443跟80端口有点类似

扫描二维码关注公众号,回复: 3852939 查看本文章
<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"  
               maxThreads="150" scheme="https" secure="true"  
               clientAuth="false" sslProtocol="TLS"   
       keystoreFile="d:\tomcattest.keystore"  
        keystorePass="111111" />

3.在浏览器添加信任的证书

谷歌浏览器--设置--高级--隐私设置和安全性--管理证书--导入证书

导入之前的文件,访问浏览器https://xx.xx.xx.xx/abc.com 即可。

但是还是会提示不安全,java自带的证书 ,未经过CA认证.

猜你喜欢

转载自blog.csdn.net/qq_25911515/article/details/83376760