Tomcat配置强制https端口变成8443的解决办法
明确:
http默认端口 80
https默认端口 443
将redirectPort=”8443”改为
redirectPort=”443”
service.xml
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="443" /> <!-- 配置属性:algorithm认证编码算法默认SunX509,clientAuth是否使用证书链,默认为false,sslprotocol表示ssl协议版本号,默认TLS,cipers可以使用的加密算法列表,用逗号隔开。 如果连接器上有http2protocol类型的升级协议upgradeprotocol组件,尝试把压缩参数放上面connector.findUpgradeProtocols(), --> <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" keystoreFile="cert/XXX.pfx" cipers="RSA,ECC" keystoreType="PKCS12" algorithm="SunX509" keystorePass="XXX" clientAuth="false" clientAuth="false" sslProtocol="TLS"> <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> </Connector>
web.xml
在welcome-file-list标签后加入
<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>
参考:https://blog.csdn.net/a1837634447/article/details/78270292
相关推荐
FanErZong 2020-07-18
86284851 2020-06-16
85427617 2020-06-13
86284851 2020-02-28
81510598 2020-01-08
88291846 2020-01-04
86284851 2019-12-28
detianlangzi 2014-06-17
85427617 2019-12-24
87497118 2019-11-28
82981634 2014-03-25
85427617 2015-08-19
81510598 2019-11-11
86284851 2019-11-08
doITwhat 2015-09-11
81477515 2016-05-20