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>

猜你喜欢

转载自blog.csdn.net/weixin_40295575/article/details/81060654