首页 > Web开发 > 详细

购买阿里云免费https证书,配置tomcat实现https加密访问

时间:2017-02-08 18:06:52      阅读:786      评论:0      收藏:0      [点我收藏+]

购买免费证书:https://common-buy.aliyun.com/?commodityCode=cas#/buy 

下载安装严格按照阿里云官网 主要说明下tomcat配置需要注意的

conf下的server.xml 配置  (80 http默认   443https默认)

<Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" 
            keystoreFile="cert/xxx.jks" keystorePass="xxxxx"/>

<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />

输入https://www.xxx.com 即可访问,不带端口号

conf下的web.xml修改

 1     <welcome-file-list>
 2         <welcome-file>index.html</welcome-file>
 3         <welcome-file>index.htm</welcome-file>
 4         <welcome-file>index.jsp</welcome-file>
 5     </welcome-file-list>
 6 
 7 <login-config>
 8  <!-- Authorization setting for SSL -->
 9  <auth-method>CLIENT-CERT</auth-method>
10  <realm-name>Client Cert Users-only Area</realm-name>
11  </login-config>
12 
13  <security-constraint>
14 <!-- Authorization setting for SSL -->
15  <web-resource-collection >
16  <web-resource-name >SSL</web-resource-name>
17  <url-pattern>/*</url-pattern>
18  </web-resource-collection>
19  <user-data-constraint>
20  <transport-guarantee>CONFIDENTIAL</transport-guarantee>
21  </user-data-constraint>
22  </security-constraint>

 

输入域名或者http://强制跳转到https://服务

 

购买阿里云免费https证书,配置tomcat实现https加密访问

原文:http://www.cnblogs.com/ybyi/p/6379282.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!