http connector redirecting to 8443 even though the redirectPort on the connector is changed in JBoss EAP 5.x

Solution Unverified - Updated -

Issue

  • We are trying to force http requests to our web application to redirect to https. We are running http on port 80 and https on port 443 and have the redirectPort set to 443 on the http connector. In our web.xml we are setting the security-containts as described in this article 'Forcing requests to https in JBoss and Tomcat' - https://access.redhat.com/site/solutions/37664 , but when we do a http get on our http://hostname/example/test servlet, it is trying to connect to 8443 instead of the 443 we have configured in the server.xml
      <Connector protocol="HTTP/1.1" port="80" address="${jboss.bind.address}"
               connectionTimeout="200000" redirectPort="443" bufferSize="2048" server="MyServer"/>

      <Connector protocol="HTTP/1.1" SSLEnabled="true"
           port="443" address="${jboss.bind.address}"
           scheme="https" secure="true" clientAuth="false"
           keystoreFile="${jboss.server.home.dir}/conf/jbossweb.keystore"
           keystorePass="keystorepass"
           truststoreFile="${jboss.server.home.dir}/conf/jbossweb.truststore"
           truststorePass="truststorepass"
           sslProtocol = "TLS" server="MyServer"/>

web.xml:

          <security-constraint>
                <web-resource-collection>
                        <web-resource-name>NoAccess</web-resource-name>
                        <url-pattern>/*</url-pattern>
                           <http-method>DELETE</http-method>
                           <http-method>PUT</http-method>
                           <http-method>GET</http-method>
                           <http-method>POST</http-method>
                           <http-method>HEAD</http-method>
                           <http-method>OPTIONS</http-method>
                           <http-method>TRACE</http-method>
                   </web-resource-collection>
                <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
        </security-constraint>
wget http://hostname.com/example/test.jsp
--2013-09-28 08:56:36--  http://hostname.com/example/test.jsp
Resolving hostname.com (hostname.com)... 192.168.1.101
Connecting to hostname.com (hostname.com)|192.168.1.101|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://hostname.com:8443/example/test.jsp [following]
--2013-09-28 08:56:37--  https://hostname.com:8443/example/test.jsp
Connecting to hostname.com (hostname.com)|192.168.1.101|:8443...

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.1.1
    • 5.1.0
    • 5.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.