7 Replies Latest reply on Mar 13, 2015 1:24 PM by dnovo

    Undertow redirect port for HTTPS

    froed

      Hi all,

       

      the last days I tried to setup WildFly 8.0.0.Beta1 to work with HTTPS. The only thing not working yet is the redirection of HTTP -> HTTPS.

       

      To my knowledge I have to setup Realm and https listener and add CONFIDENTIAL to web.xml.

       

      <security-realm name="UndertowRealm">

                      <server-identities>

                          <ssl>

                              <keystore

                                  relative-to="jboss.server.config.dir"

                                  path="path-to-keystore"                           

                                  keystore-password="the-pwd"/>

                          </ssl>

                      </server-identities>

                  </security-realm>

       

      <https-listener name="https" socket-binding="https" security-realm="UndertowRealm"/>

       

      and in web.xml

       

      <security-constraint>

        <web-resource-collection>

            <url-pattern>/*</url-pattern>

        </web-resource-collection>

        <user-data-constraint>

            <transport-guarantee>CONFIDENTIAL</transport-guarantee>

        </user-data-constraint>

      </security-constraint>

       

      the part in the web.xml seems to be responsible for the redirect HTTP -> HTTPS which returns for http://domain.net -> https://domain.net

       

      I am using the Wildfly in the cloud and the cloud provider allows to define port mapping from public to private ports. In the case of Wildfly I have the following:

      Public -> Private

      80 -> 8080

      443 -> 8443

       

      What happens is that the request http://domain.net is redirected to https://domain.net:8443 instead of https://domain.net

       

      My question is now, how can I configure the Wildfly to redirect to 443 instead of 8443 but still use the binding port 8443 for HTTPS???