1 Reply Latest reply on Oct 17, 2012 5:52 PM by Saran Arul

    Creating a custom HTTPSConnector is JBOSS AS 7.1

    Saran Arul Newbie

      I need to extend the default HTTPS connector in JBOSS AS 7.1 and add some custom code. Are there any examples I can look into to get started ?

       

      <subsystem xmlns="urn:jboss:domain:web:1.2" default-virtual-server="default-host" native="false">

                  <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true">

                   <ssl name="ssl"

                   key-alias="test"

                   password="nextgen!"

                   certificate-key-file="/Users/sarul/jboss-as-7.1.3.Final/standalone/configuration/test.keystore"

                   protocol="TLSv1"

                   verify-client="false"/>

                  </connector>

                    <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

                  <virtual-server name="default-host" enable-welcome-root="true">

                      <alias name="localhost"/>

                      <alias name="example.com"/>

                  </virtual-server>

              </subsystem>

       

      I guess my questions at this point are,

       

      1. Which class implements the default HTTPS connector highlighted above ?

      2. Is this class extensible ? Where can I find an example to do that ?

      3. Once I have the extended class, how do I package it and what configuration should I change in standalone.xml to enable by custom connector ?

        • 1. Re: Creating a custom HTTPSConnector is JBOSS AS 7.1
          Saran Arul Newbie

          Looks like the way to do this is to write a custom protocol handler class (extending any of the standard handlers like org.apache.coyote.http11.Http11Protocol) and specifying that class name in the protocol attribute as follows,

           

          <subsystem xmlns="urn:jboss:domain:web:1.2" default-virtual-server="default-host" native="false">

                      <connector name="https" protocol="com.yourcompany.infra.CustomHttpsHandler" scheme="https" socket-binding="https" enable-lookups="false" secure="true">

                       <ssl name="ssl"

                       key-alias="test"

                       password="nextgen!"

                       certificate-key-file="/Users/sarul/jboss-as-7.1.3.Final/standalone/configuration/test.keystore"

                       protocol="TLSv1"

                       verify-client="false"/>

                      </connector>

                        <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

                      <virtual-server name="default-host" enable-welcome-root="true">

                          <alias name="localhost"/>

                          <alias name="example.com"/>

                      </virtual-server>

                  </subsystem>

           

          This seems to work for me so far.