<title>SSL Test Installation</title>

<summarylist/>

This section gives a quick guide to installing a test SSL
configuration.  It avoids as many complications as possible and uses
Sun's keytool to create a server certificate.

<section title="Install JSSE from Sun">

Resin's SSL support is provided by Sun's
<a href='http://java.sun.com/products/jsse'>JSSE</a>.  Because of
export restrictions, patents, etc, you'll need to download the JSSE
distribution from Sun or get a commercial JSSE implementation.

<p/>More complete JSSE installation instructions for JSSE are at
<a href="http://java.sun.com/products/jsse/install.html">http://java.sun.com/products/jsse/install.html</a>.

<ol>
<li>First download Sun's <a href="http://java.sun.com/products/jsse">JSSE</a>.
<li>Uncompress and extract the downloaded file.
<li>Install the JSSE jar files: jsse.jar, jnet.jar, and jcert.jar.  You can
either put them into the CLASSPATH or you can put them into $JAVA_HOME/jre/lib/ext.  Since you will use "keytool" with the new jars, you need to make them
visible to keytool.  Just adding them to resin/lib is not enough.
<li>Register the JSSE provider (com.sun.net.ssl.internal.ssl.Provider).
Modify $JAVA_HOME/jre/lib/security/java.security so it contains something like:
<example>
security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
</example>
Adding the JSSE provider allows "keytool" to create a key using the RSA
algorithm.
</ol>

</section>

<section title="Create a test server certificate">

The server certificate is the core of SSL.  It will identify your server and
contain the secret key to make encryption work.

<ul>
<li>Sun's keytool
<li>A self-signed certificate using open_ssl
<li>A test certificate from Thawte
<li>A production certificate from one of the certificate authorities (Verisign, Thawte, etc)
</ul>

<p/>In this case, we're using Sun's <var/keytool/> to generate the
server certificate.  Here's how:

<example>
resin1.2.b2> <var/mkdir keys/>
resin1.2.b2> <var/keytool -genkey -keyalg RSA -keystore keys/server.keystore/>
Enter keystore password:  <var/changeit/>
What is your first and last name?
  [Unknown]:  <var/www.caucho.com/>
What is the name of your organizational unit?
  [Unknown]:  <var/Resin Engineering/>
What is the name of your organization?
  [Unknown]:  <var/Caucho Technology, Inc./>
What is the name of your City or Locality?
  [Unknown]:  <var/San Francisco/>
What is the name of your State or Province?
  [Unknown]:  <var/California/>
What is the two-letter country code for this unit?
  [Unknown]:  <var/US/>
Is &lt;CN=www.caucho.com, OU=Resin Engineering,
  O="Caucho Technology, Inc.", L=San Francisco, ST=California, C=US> correct?
  [no]:  <var/yes/>

Enter key password for &lt;mykey>
        (RETURN if same as keystore password):  <var/changeit/>
</example>

Currently, the key password and the keystore password must be the same.

</section>

<section title="resin.conf">

The Resin SSL configuration extends the http configuration with a few new
elements.

<example>
&lt;caucho.com>
  &lt;http-server>

    &lt;http port=8443>
     &lt;ssl>true&lt;/ssl>
     &lt;key-store-file>keys/server.keystore&lt;/key-store-file>
     &lt;key-store-password>changeit&lt;/key-store-password>
    &lt;/http>

    ...

  &lt;/http-server>
&lt;/caucho.com>
</example>

</section>

<section title="Testing">

With the above configuration, you can test SSL with https://localhost:8443.
A quick test is the following JSP.

<example>
Secure? &lt;%= request.isSecure() %>
</example>

</section>
