How to avoid redirecting to SSL port

爱⌒轻易说出口 提交于 2019-12-24 01:52:03

问题


My Web.xml config in my SSL confugured web app(deployed on tomcat(8080 port)) is as follows

<security-constraint>
    <web-resource-collection>
        <web-resource-name>HTTPSOnly</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

When I tried https://google.com, I am getting the page When I tried http://google.com, it automatically redirects to https://google.com:8443. So I am not getting the page.

I want it to be redirect to https://google.com instead of https://google.com:8443.

Kindly help me. Will let u know if u need any further details.


回答1:


I got it. Removed SSL redirectPort from server.xml of tomcat

<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000" redirectPort="8443" />

like,

<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000" />


来源:https://stackoverflow.com/questions/14643441/how-to-avoid-redirecting-to-ssl-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!