Windows版:
1、为服务器生成证书
keytool -genkey -keyalg RSA -dname "cn=127.0.0.1,ou=xxx,o=xxx,l=GZ,st=GD,c=CN" -alias server -keypass 123456 -keystore F:/server.keystore -storepass 123456 -validity 36
2、修改tomcat配置文件server.xml
<Connector SSLEnabled="true" clientAuth="false"
maxThreads="150" port="8443"
protocol="org.apache.coyote.http11.Http11Protocol"
scheme="https" secure="true" sslProtocol="TLS"
keystoreFile="F:/server.keystore" keystorePass="123456"/>
参考网址:http://blog.csdn.net/kent7306/article/details/50547388
docker web服务添加https单向认证
1、将证书映射进docker容器中
<Connector SSLEnabled="true" clientAuth="false"
maxThreads="150" port="[容器中的端口]"
protocol="org.apache.coyote.http11.Http11Protocol"
scheme="https" secure="true" sslProtocol="TLS"
keystoreFile="[容器中的证书地址]" keystorePass="123456"/>
1、为服务器生成证书
keytool -genkey -keyalg RSA -dname "cn=127.0.0.1,ou=xxx,o=xxx,l=GZ,st=GD,c=CN" -alias server -keypass 123456 -keystore F:/server.keystore -storepass 123456 -validity 36
2、修改tomcat配置文件server.xml
<Connector SSLEnabled="true" clientAuth="false"
maxThreads="150" port="8443"
protocol="org.apache.coyote.http11.Http11Protocol"
scheme="https" secure="true" sslProtocol="TLS"
keystoreFile="F:/server.keystore" keystorePass="123456"/>
参考网址:http://blog.csdn.net/kent7306/article/details/50547388
docker web服务添加https单向认证
1、将证书映射进docker容器中
如:
<Connector SSLEnabled="true" clientAuth="false"
maxThreads="150" port="[容器中的端口]"
protocol="org.apache.coyote.http11.Http11Protocol"
scheme="https" secure="true" sslProtocol="TLS"
keystoreFile="[容器中的证书地址]" keystorePass="123456"/>