<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    JBoss AS7: Configuring SSL on JBoss Web
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/anil.saldhana">Anil Saldhana</a> in <i>PicketBox Development</i> - <a href="https://community.jboss.org/docs/DOC-17503">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><strong style="color: #ff0000;">Disclaimer:&#160; Article is still in progress and is not definitive.</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>There are 3 sets of connectors that one can configure with JBossWeb.</p><ul><li style="text-align: start;">AJP Connectors</li><li style="text-align: start;">HTTP/HTTPS Connectors</li><li style="text-align: start;">Native Connectors</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;"><strong>AJP Connectors</strong> are primarily used to service requests coming from a web server such as Apache Httpd with mod_jk, mod_cluster etc in between.</p><p style="text-align: start;"><strong>HTTP/HTTPS Connectors</strong> are the standard connectors that can service web requests directly.</p><p style="text-align: start;"><strong>Native Connectors</strong> use the APR subsystem and provide better performance.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">In JBoss AS7, the web subsystem configuration is performed in the web module in standalone.xml or domain.xml</p><h3 style="text-align: start;"></h3><h3 style="text-align: start;">Important Points to remember:</h3><ol><li style="text-align: start;">The intention of the JBossWeb developers has been to unify the SSL configuration for all the connectors via the &lt;ssl/&gt; subelement.</li><li style="text-align: start;">When the native modules exist in JBoss AS (in the<em> lib</em> folder of JBOSS_HOME/modules/org/jboss/as/web/main), the Native Connector settings come into play.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">jboss-as-7.1.0.Final-SNAPSHOT/modules/org/jboss/as/web/main$ ls
jasper-jdt-7.0.3.Final.jar&#160;&#160;&#160;&#160;&#160;&#160;&#160; jboss-as-web-7.1.0.Final-SNAPSHOT.jar&#160;&#160;&#160;&#160;&#160;&#160;&#160; jbossweb-7.0.8.Final.jar&#160;&#160;&#160;&#160;&#160;&#160;&#160; lib
jasper-jdt-7.0.3.Final.jar.index&#160; jboss-as-web-7.1.0.Final-SNAPSHOT.jar.index&#160; jbossweb-7.0.8.Final.jar.index&#160; module.xml

anil@localhost:~jboss-as-7.1.0.Final-SNAPSHOT/modules/org/jboss/as/web/main$ ls lib/
linux-i686&#160; linux-x86_64&#160; macosx-i686&#160; macosx-x86_64&#160; win-i686&#160; win-x86_64
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>As you can see the native libraries for each os architecture is available here.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #0000ff;"><strong><em><span style="color: #ff0000;">===&gt;</span> If you do not want the native connector settings kicking in, you should remove the lib directory and its contents.&#160; <span style="color: #ff0000;">&lt;====</span><br/></em></strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3></h3><h3>Working With KeyStores</h3><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>For SSL settings, we will need access to a keystore. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If there is Client Certificate based authentication, then we will need to have access to a trust store also.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3></h3><h3>Preferred KeyStores</h3><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>For Native Connector settings,&#160; use the OpenSSL generated certificates and Keys.</p><p>For the Https Connector settings, you can use the Java Keytool generated keystore.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>OpenSSL Generated Key and Certificate</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Three Steps are involved.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Step 1: </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">$ openssl genrsa -des3 -out newkey.pem 1024
Generating RSA private key, 1024 bit long modulus
...........................................++++++
.........++++++
e is 65537 (0x10001)
Enter pass phrase for newkey.pem:
Verifying - Enter pass phrase for newkey.pem:
</code></pre><p>I used a pass phrase of "mykey"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Step 2:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">$ openssl req -new -key newkey.pem -out server.csr
Enter pass phrase for newkey.pem:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:US
State or Province Name (full name) []:IL
Locality Name (eg, city) [Default City]:Chicago
Organization Name (eg, company) [Default Company Ltd]:RedHat
Organizational Unit Name (eg, section) []:JBoss
Common Name (eg, your name or your server's hostname) []:Anil
Email Address []:anil@apache.org

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:mykey
An optional company name []:
</code></pre></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="https://community.jboss.org/docs/DOC-17503">going to Community</a></p>

        <p style="margin: 0;">Create a new document in PicketBox Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2088">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>