購買阿里雲免費https證書,配置tomcat實現https加密訪問


購買免費證書: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://服務

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM