tomcat服務器設置從http跳轉到https

    實現這步之前相信ssl證書什麼的都設置好了,端口什麼的都沒問題了,就剩下訪問的問題了,如果不對tomcat服務器中的web設置,在輸入你的域名的時候訪問的還是http的,因此在服務器下的conf文件夾中設置web.xml,在其中加入以下代碼即可!!!



<login-config>
	<!-- Authorization setting for SSL -->
	<auth-method>CLIENT-CERT</auth-method>
	<realm-name>Client Cert Users-only Area</realm-name>
	</login-config>
	<security-constraint>
	<!-- Authorization setting for SSL -->
	<web-resource-collection >
	<web-resource-name >SSL</web-resource-name>
	<url-pattern>/*</url-pattern>
	</web-resource-collection>
	<user-data-constraint>
	<transport-guarantee>CONFIDENTIAL</transport-guarantee>
	</user-data-constraint>
	</security-constraint>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章