8 Replies Latest reply on Oct 30, 2012 2:19 PM by fyakin

    Redirect 8080 to 8443 on gatein portal

    rabee

      Hello,

       

      I am using jboss-epp-5.1 gatein. Actualy I integrated a jsf project via portlet-bridge to gateing portal. Recently I configured SSL on the jboss server and it works correctly. For example when going to "https://localhost:8443/portal", it shows the SSL confirmation message.

       

      Now I want to configure the gatein portal when inserting "http://localhost:8080/portal", it gets automatically redirected to the "https://localhost:8443/portal"

       

      I changed the following on the "jboss-epp-5.1.0\jboss-epp-5.1\jboss-as\server\default\deploy\gatein.ear\02portal.war\WEB-INF\web.xml"  :

       

      <user-data-constraint>

                <transport-guarantee>NONE</transport-guarantee>

      </user-data-constraint>

       

      to

       

      <user-data-constraint>

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

      </user-data-constraint>

       

      But it does not work.


      PN: I have my jsf project as a portlet in the gatein portal.

       

      Any help would be appreciated.

       

       

      Special Thanks,

      Rabee

        • 1. Redirect 8080 to 8443 on gatein portal
          rraposa

          When you say it doesn't work, what happens exactly? And are you getting any kind of error message?

           

          Maybe show us the rest of your <security-constraint> in web.xml. You may have an issue with your url-pattern.

          • 2. Redirect 8080 to 8443 on gatein portal
            rabee

            No I do'nt get any error or exception.

            I expect when going to  "http://localhost:8080/portal" the browser change it to "https://localhost:8443/portal". But it does not change to the secure ssl url. It remains the same like "http://localhost:8080/portal" and the site loads as usual.

             

            the <security-constraint> in web.xml is defual of gatein.ear :

             

            jboss-epp-5.1.0\jboss-epp-5.1\jboss-as\server\default\deploy\gatein.ear\02portal.war\WEB-INF\web.xml

             

             

            <security-constraint>

                    <web-resource-collection>

                      <web-resource-name>user authentication</web-resource-name>

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

                      <http-method>POST</http-method>

                      <http-method>GET</http-method>

                  </web-resource-collection>

                    <auth-constraint>

                      <role-name>users</role-name>

                  </auth-constraint>

                    <user-data-constraint>

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

                  </user-data-constraint>

                </security-constraint>

                <security-constraint>

                    <web-resource-collection>

                      <web-resource-name>admin authentication</web-resource-name>

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

                      <http-method>POST</http-method>

                      <http-method>GET</http-method>

                  </web-resource-collection>

                    <auth-constraint>

                         <role-name>admin</role-name>

                  </auth-constraint>

                    <user-data-constraint>

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

                  </user-data-constraint>

                </security-constraint>

             

             

            Many Thanks,

            Rabee

            • 3. Redirect 8080 to 8443 on gatein portal
              rabee

              And this is the configuration of server.xml:

               

              <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"

                             compression="on"

                             compressableMimeType="text/html,text/xml,text/css,text/javascript, application/x-javascript,application/javascript"

                             connectionTimeout="20000" redirectPort="8443"    />

               

                <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"

                       redirectPort="8443" />

               

              <Connector protocol="HTTP/1.1" SSLEnabled="true"

                         port="8443" address="${jboss.bind.address}"

                         scheme="https" secure="true" clientAuth="false"

                         keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"

                         keystorePass="ehrkeystore" sslProtocol = "TLS" />

              • 4. Redirect 8080 to 8443 on gatein portal
                rraposa

                Sorry Rabee - I didn't look closely to your URLs. If you go to:

                 

                http://localhost:8080/portal

                 

                then the portal site will load normally. For the SSL redirect to work, you need to add the "s" to the protocol:

                 

                https://localhost:8080/portal

                 

                That should redirect you to 8443.    

                • 5. Redirect 8080 to 8443 on gatein portal
                  rabee

                  I want the server automathically does it. I want may portal load on ssl authomatically even if the user enter the http://localhost:8080/portal.

                  I mean the server should automatically change the http://localhost:8080/portal to https://localhost:8080/portal

                  • 6. Redirect 8080 to 8443 on gatein portal
                    rraposa

                    I suppose you could modify your index.jsp file to do the redirect. Or install Apache out in front and use mod_rewrite. I don't think Tomcat is capable of the behavior you want.

                    • 7. Redirect 8080 to 8443 on gatein portal
                      rabee

                      Thanks very much Rich. 

                      • 8. Re: Redirect 8080 to 8443 on gatein portal
                        fyakin

                        Hi Rabee,

                         

                        Did you find the solution with redirecting port 8080 to port 8443?

                         

                        I have the same problem now

                         

                        Could you share with me, if your issue resolved yet? And what I need to do?

                         

                        Thanks

                         

                        Francis