<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CB1, INC. &#187; ssl</title>
	<atom:link href="http://www.cb1inc.com/category/ssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cb1inc.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Sep 2011 17:54:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Virtual Hosts and Wildcard SSL Certificates with Apache 2.2</title>
		<link>http://www.cb1inc.com/2008/09/11/virtual-hosts-and-wildcard-ssl-certificates-with-apache-2-2/</link>
		<comments>http://www.cb1inc.com/2008/09/11/virtual-hosts-and-wildcard-ssl-certificates-with-apache-2-2/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 07:00:15 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[It is possible with Apache to host multiple websites with a single static IP address.  However, you can only have one SSL certificate per static IP.  This post describes setting up Apache with multiple secure virtual hosts and a single self-signed wildcard certificate.  To learn about creating the certificate, check out <a href="http://www.cb1inc.com/2007/05/13/creating-self-signed-certs-on-apache-2.2">Creating Self-Signed Certs on Apache 2.2</a>.

Here's a table of our example hosts:

<table>
<thead><tr>
<th>Domain</th><th>Force SSL?</th><th>Trusted?</th><th>Valid Domain?</th>
</tr></thead>
<tbody>
<tr><td>www.site-a.com</td><td>No</td><td>No</td><td>Yes</td></tr>
<tr><td>secure.site-a.com</td><td>Yes</td><td>No</td><td>Yes</td></tr>
<tr><td>test.site-a.com</td><td>No</td><td>No</td><td>Yes</td></tr>
<tr><td>www.site-b.com</td><td>No</td><td>No</td><td>No</td></tr>
<tr><td>secure.site-b.com</td><td>Yes</td><td>No</td><td>No</td></tr>
</tbody></table>

In order for the certificate to be trusted, you need to obtain the certificate from a trusted <a href="http://en.wikipedia.org/wiki/Certificate_Authority">certificate authority</a>. Since we are using self-signed certificates, they are not trusted and we will see some warning messages. The data will still be encrypted.

For this to work, we are going to use <a href="http://httpd.apache.org/docs/2.2/vhosts/name-based.html">name-based virtual hosts</a>.

The name and location of Apache's configuration files vary based on which platform you use.  This post assumes Ubuntu in which case the configuration files in the <code>/etc/apache2</code> directory.

For starters, we need to tell Apache which ports to listen on by editing the file <code>/etc/apache2/ports.conf</code>.

<pre><code>Listen 80
&#60;IfModule mod_ssl.c&#62;
    Listen 443
&#60;/IfModule&#62;</code></pre>

Next we need to add our virtual hosts.  They are kept in the <code>/etc/apache2/sites-available</code> directory.  For organization purposes, separate your sites into separate config files, then run <code>a2ensite</code> for each site to generate a symbolic link in the <code>/etc/apache2/sites-enabled</code> directory.

Here is the configuration for the sites:

<pre><code>NameVirtualHost 192.168.1.200:80
NameVirtualHost 192.168.1.200:443

# http://site-a.com
# https://site-a.com -- Throws warning because cert is for *.site-a.com... see bottom
# http://www.site-a.com
# https://www.site-a.com
&#60;VirtualHost 192.168.1.200:80 192.168.1.200:443&#62;
  ServerName site-a.com
  ServerAlias www.site-a.com
  DocumentRoot /path/to/www.site-a
  # Note: SSL settings only need to be defined once!
  SSLEngine On
  SSLCertificateFile /path/to/thecert.crt
  SSLCertificateKeyFile /path/to/thecert.key
&#60;/VirtualHost&#62;

# Not SSL, redirect to https://secure.site-a.com
&#60;VirtualHost 192.168.1.200:80&#62;
  ServerName secure.site-a.com
  Redirect / https://secure.site-a.com/
&#60;/VirtualHost&#62;

# https://secure.site-a.com
&#60;VirtualHost 192.168.1.200:443&#62;
  ServerName secure.site-a.com
  DocumentRoot /path/to/secure.site-a
&#60;/VirtualHost&#62;

# http://test.site-a.com
# https://test.site-a.com
&#60;VirtualHost 192.168.1.200:80 192.168.1.200:443&#62;
  ServerName test.site-a.com
  DocumentRoot /path/to/test.site-a
&#60;/VirtualHost&#62;

# http://www.site-b.com
# https://www.site-b.com -- Throws warning because cert is for *.site-a.com
&#60;VirtualHost 192.168.1.200:80 192.168.1.200:443&#62;
  ServerName www.site-b.com
  DocumentRoot /path/to/secure.site-b
&#60;/VirtualHost&#62;

# Not SSL, redirect to https://secure.site-b.com
&#60;VirtualHost *:80&#62;
  ServerName secure.site-b.com
  Redirect / https://secure.site-b.com/
&#60;/VirtualHost&#62;

# https://secure.site-b.com -- Throws warning because cert is for *.site-a.com
&#60;VirtualHost 192.168.1.200:443&#62;
  ServerName secure.site-b.com
  DocumentRoot /path/to/secure.site-b
&#60;/VirtualHost&#62;</code></pre>

Despite having a wildcard certificate for <code>*.site-a.com</code>, you will get an invalid domain message when you don't supply the subdomain (i.e.  http://site-a.com).  The only way I know of to solve this is with 2 static IPs and 2 certs where one cert is for <code>site-a.com</code> and the other is for <code>*.site-a.com</code>.

I'm using 192.168.1.200 for the server's IP address behind the firewall.  You could try using * instead of 192.168.1.200 in the <code>&#60;VirtualHost&#62;</code> blocks, but I haven't tested this.  Leave a comment if you happen to test this. :)

Assuming the stars have aligned, you should have several secured virtual hosts!]]></description>
			<content:encoded><![CDATA[<p>It is possible with Apache to host multiple websites with a single static IP address.  However, you can only have one SSL certificate per static IP.  This post describes setting up Apache with multiple secure virtual hosts and a single self-signed wildcard certificate.  To learn about creating the certificate, check out <a href="/2008/05/13/creating-self-signed-certs-on-apache-2.2">Creating Self-Signed Certs on Apache 2.2</a>.</p>
<p>Here&#8217;s a table of our example hosts:</p>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Force SSL?</th>
<th>Trusted?</th>
<th>Valid Domain?</th>
</tr>
</thead>
<tbody>
<tr>
<td>www.site-a.com</td>
<td>No</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>secure.site-a.com</td>
<td>Yes</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>test.site-a.com</td>
<td>No</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>www.site-b.com</td>
<td>No</td>
<td>No</td>
<td>No</td>
</tr>
<tr>
<td>secure.site-b.com</td>
<td>Yes</td>
<td>No</td>
<td>No</td>
</tr>
</tbody>
</table>
<p>In order for the certificate to be trusted, you need to obtain the certificate from a trusted <a href="http://en.wikipedia.org/wiki/Certificate_Authority">certificate authority</a>. Since we are using self-signed certificates, they are not trusted and we will see some warning messages. The data will still be encrypted.</p>
<p>For this to work, we are going to use <a href="http://httpd.apache.org/docs/2.2/vhosts/name-based.html">name-based virtual hosts</a>.</p>
<p>The name and location of Apache&#8217;s configuration files vary based on which platform you use.  This post assumes Ubuntu in which case the configuration files in the <code>/etc/apache2</code> directory.</p>
<p>For starters, we need to tell Apache which ports to listen on by editing the file <code>/etc/apache2/ports.conf</code>.</p>
<pre class="brush: xml; title: ;">
Listen 80
&lt;IfModule mod_ssl.c&gt;
    Listen 443
&lt;/IfModule&gt;
</pre>
<p>Next we need to add our virtual hosts.  They are kept in the <code>/etc/apache2/sites-available</code> directory.  For organization purposes, separate your sites into separate config files, then run <code>a2ensite</code> for each site to generate a symbolic link in the <code>/etc/apache2/sites-enabled</code> directory.</p>
<p>Here is the configuration for the sites:</p>
<pre class="brush: xml; title: ;">
NameVirtualHost 192.168.1.200:80
NameVirtualHost 192.168.1.200:443

# http://site-a.com
# https://site-a.com -- Throws warning because cert is for *.site-a.com... see bottom
# http://www.site-a.com
# https://www.site-a.com
&lt;VirtualHost 192.168.1.200:80 192.168.1.200:443&gt;
  ServerName site-a.com
  ServerAlias www.site-a.com
  DocumentRoot /path/to/www.site-a
  # Note: SSL settings only need to be defined once!
  SSLEngine On
  SSLCertificateFile /path/to/thecert.crt
  SSLCertificateKeyFile /path/to/thecert.key
&lt;/VirtualHost&gt;

# Not SSL, redirect to https://secure.site-a.com
&lt;VirtualHost 192.168.1.200:80&gt;
  ServerName secure.site-a.com
  Redirect / https://secure.site-a.com/
&lt;/VirtualHost&gt;

# https://secure.site-a.com
&lt;VirtualHost 192.168.1.200:443&gt;
  ServerName secure.site-a.com
  DocumentRoot /path/to/secure.site-a
&lt;/VirtualHost&gt;

# http://test.site-a.com
# https://test.site-a.com
&lt;VirtualHost 192.168.1.200:80 192.168.1.200:443&gt;
  ServerName test.site-a.com
  DocumentRoot /path/to/test.site-a
&lt;/VirtualHost&gt;

# http://www.site-b.com
# https://www.site-b.com -- Throws warning because cert is for *.site-a.com
&lt;VirtualHost 192.168.1.200:80 192.168.1.200:443&gt;
  ServerName www.site-b.com
  DocumentRoot /path/to/secure.site-b
&lt;/VirtualHost&gt;

# Not SSL, redirect to https://secure.site-b.com
&lt;VirtualHost *:80&gt;
  ServerName secure.site-b.com
  Redirect / https://secure.site-b.com/
&lt;/VirtualHost&gt;

# https://secure.site-b.com -- Throws warning because cert is for *.site-a.com
&lt;VirtualHost 192.168.1.200:443&gt;
  ServerName secure.site-b.com
  DocumentRoot /path/to/secure.site-b
&lt;/VirtualHost&gt;
</pre>
<p>Despite having a wildcard certificate for <code>*.site-a.com</code>, you will get an invalid domain message when you don&#8217;t supply the subdomain (i.e.  http://site-a.com).  The only way I know of to solve this is with 2 static IPs and 2 certs where one cert is for <code>site-a.com</code> and the other is for <code>*.site-a.com</code>.</p>
<p>I&#8217;m using 192.168.1.200 for the server&#8217;s IP address behind the firewall.  You could try using * instead of 192.168.1.200 in the <code>&lt;VirtualHost&gt;</code> blocks, but I haven&#8217;t tested this.  Leave a comment if you happen to test this. <img src='http://www.cb1inc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Assuming the stars have aligned, you should have several secured virtual hosts!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2008/09/11/virtual-hosts-and-wildcard-ssl-certificates-with-apache-2-2/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Creating Self-Signed Certs on Apache 2.2</title>
		<link>http://www.cb1inc.com/2007/05/13/creating-self-signed-certs-on-apache-2-2/</link>
		<comments>http://www.cb1inc.com/2007/05/13/creating-self-signed-certs-on-apache-2-2/#comments</comments>
		<pubDate>Sun, 13 May 2007 23:07:14 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Security is a always a big concern and there's no reason your website should go unsecure. You can secure your Apache website with a self-signed SSL certificate. This post describes the process using Apache 2.2 and <a href="http://www.openssl.org" target="_blank">OpenSSL</a> on a Ubuntu Linux server.

Begin by generating a private key:

<div class="cb1-docs-code"><pre>&#62; openssl genrsa -out mycert.key 1024</pre></div>

Next, generating a certificate request and enter the information:

<div class="cb1-docs-code"><pre>&#62; openssl req -new -key mycert.key -out mycert.csr
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) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:</pre></div>

Next, generate the self-signed certificate. You can specify the number of days the cert is valid for.

<div class="cb1-docs-code"><pre>&#62; openssl x509 -req -days 365 -in mycert.csr -signkey mycert.key -out mycert.cert
Signature ok
subject=/C=/ST=/L=/O=/CN=
Getting Private key</pre></div>

You no longer need the .csr request file. Create a folder and move the .key and .cert files into it:

<div class="cb1-docs-code"><pre>&#62; sudo mkdir /etc/apache2/ssl
&#62; sudo mv *.cert /etc/apache2/ssl
&#62; sudo mv *.key /etc/apache2/ssl
&#62; sudo chmod 400 /etc/apache2/ssl/*.key</pre></div>

If the cert is protected with a password, by default Apache will prompt for the password when it starts. This can be a problem since you will need to enter the password each time Apache is restarted. We can fix this by having Apache call a program that returns the password.

Create the shell script <code>/etc/apache2/ssl/password.sh</code> and enter the following:

<div class="cb1-docs-code"><pre>#!/bin/bash
echo “password”;</pre></div>

Next we need to tell Apache to run the script. Apache's SSL settings are stored in:

<div class="cb1-docs-code"><pre>/etc/apache2/mods-enabled/ssl.conf</pre></div>

Edit the file and change the <code>SSLPassPhraseDialog</code> to:

<div class="cb1-docs-code"><pre>SSLPassPhraseDialog exec:/etc/apache2/ssl/password.sh</pre></div>

The last step is to assign the certificate to your Apache site by editing the sites file:

<div class="cb1-docs-code"><pre>/etc/apache2/sites-enabled/000-default</pre></div>

You'll need to configure the SSL settings for the site:

<div class="cb1-docs-code"><pre>&#60;VirtualHost 192.168.1.100:443&#62;
        ...
        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/mycert.cert
        SSLCertificateKeyFile /etc/apache2/ssl/mycert.key
        ...
&#60;/VirtualHost&#62;</pre></div>

Don't forget to tell Apache to listen on port 443 in the <code>/etc/apache2/ports.conf</code> file. Restart Apache with <code>sudo apache2ctl restart</code> and you should be a little closer to being secure.]]></description>
			<content:encoded><![CDATA[<p>Security is a always a big concern and there&#8217;s no reason your website should go unsecure. You can secure your Apache website with a self-signed SSL certificate. This post describes the process using Apache 2.2 and <a href="http://www.openssl.org" target="_blank">OpenSSL</a> on a Ubuntu Linux server.</p>
<p>Begin by generating a private key:</p>
<pre class="brush: plain; title: ;">
$ openssl genrsa -out mycert.key 1024
</pre>
<p>Next, generating a certificate request and enter the information:</p>
<pre class="brush: plain; title: ;">
$ openssl req -new -key mycert.key -out mycert.csr
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) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
</pre>
<p>Next, generate the self-signed certificate. You can specify the number of days the cert is valid for.</p>
<pre class="brush: plain; title: ;">
$ openssl x509 -req -days 365 -in mycert.csr -signkey mycert.key -out mycert.cert
Signature ok
subject=/C=/ST=/L=/O=/CN=
Getting Private key
</pre>
<p>You no longer need the .csr request file. Create a folder and move the .key and .cert files into it:</p>
<pre class="brush: bash; title: ;">
$ sudo mkdir /etc/apache2/ssl
$ sudo mv *.cert /etc/apache2/ssl
$ sudo mv *.key /etc/apache2/ssl
$ sudo chmod 400 /etc/apache2/ssl/*.key
</pre>
<p>If the cert is protected with a password, by default Apache will prompt for the password when it starts. This can be a problem since you will need to enter the password each time Apache is restarted. We can fix this by having Apache call a program that returns the password.</p>
<p>Create the shell script <code>/etc/apache2/ssl/password.sh</code> and enter the following:</p>
<pre class="brush: bash; title: ;">
#!/bin/bash
echo “password”;
</pre>
<p>Next we need to tell Apache to run the script. Apache&#8217;s SSL settings are stored in:</p>
<pre class="brush: plain; title: ;">
/etc/apache2/mods-enabled/ssl.conf
</pre>
<p>Edit the file and change the <code>SSLPassPhraseDialog</code> to:</p>
<pre class="brush: plain; title: ;">
SSLPassPhraseDialog exec:/etc/apache2/ssl/password.sh
</pre>
<p>The last step is to assign the certificate to your Apache site by editing the sites file:</p>
<pre class="brush: plain; title: ;">
/etc/apache2/sites-enabled/000-default
</pre>
<p>You&#8217;ll need to configure the SSL settings for the site:</p>
<pre class="brush: plain; title: ;">
&lt;VirtualHost 192.168.1.100:443&gt;
        ...
        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/mycert.cert
        SSLCertificateKeyFile /etc/apache2/ssl/mycert.key
        ...
&lt;/VirtualHost&gt;
</pre>
<p>Don&#8217;t forget to tell Apache to listen on port 443 in the <code>/etc/apache2/ports.conf</code> file. Restart Apache with <code>sudo apache2ctl restart</code> and you should be a little closer to being secure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/05/13/creating-self-signed-certs-on-apache-2-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating Self-Signed Certs on Apache Tomcat 5.5</title>
		<link>http://www.cb1inc.com/2007/05/12/creating-self-signed-certs-on-apache-tomcat-5-5/</link>
		<comments>http://www.cb1inc.com/2007/05/12/creating-self-signed-certs-on-apache-tomcat-5-5/#comments</comments>
		<pubDate>Sat, 12 May 2007 15:13:32 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Recently I needed to generate a self-signed SSL cert for Apache Tomcat 5.5 on my Ubuntu Linux server. The basic process is to create a Java keystore with the self-signed cert, change Tomcat's configuration file, and restart the server. Here's how I did it:

<div class="cb1-docs-code"><pre>&#62; keytool -genkey -alias tomcat -keyalg RSA -keystore mycert.jks
Enter keystore password:  changeit
What is your first and last name?
  [Unknown]:  Chris Barber
What is the name of your organizational unit?
  [Unknown]:  
What is the name of your organization?
  [Unknown]:  CB1, INC.
What is the name of your City or Locality?
  [Unknown]:  Minneapolis
What is the name of your State or Province?
  [Unknown]:  MN
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=Chris Barber, OU=Unknown, O="CB1, INC.", L=Minneapolis, ST=MN, C=US correct?
  [no]:  yes

Enter key password for <tomcat>
        (RETURN if same as keystore password):  
</pre></div>

By default, Tomcat will assume the password as "changeit".  You can change the password, but then you need to set the keystorePass in Tomcat's configuration file. Regardless, the password for both the keystore and the cert MUST be the same.  Store the keystore in a safe place such as Tomcat's configuration folder:

<div class="cb1-docs-code"><pre>/etc/tomcat5.5</pre></div>

Next edit Tomcat's server configuration file:

<div class="cb1-docs-code"><pre>/etc/tomcat5.5/server.xml</pre></div>

Locate the SSL connector declaration, uncomment it, and add the keystoreFile path:

<div class="cb1-docs-code"><pre>
&#60;!-- Define a SSL HTTP/1.1 Connector on port 8443 --&#62;
&#60;Connector port="8443" maxHttpHeaderSize="8192"
        maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
        enableLookups="false" disableUploadTimeout="true"
        acceptCount="100" scheme="https" secure="true"
        keystoreFile="/etc/tomcat5.5/mycert.jks"
        clientAuth="false" sslProtocol="TLS" /&#62;
</pre></div>

Save the changes and restart Tomcat:

<div class="cb1-docs-code"><pre>sudo /etc/init.d/tomcat5.5 restart</pre></div>

You should be good to go at this point. Launch your <a href="http://www.mozilla.com" target="_blank">favorite web browser</a> and go to https://localhost:8443.

<div align="center"><img alt="SSL dialog" src="/sites/default/blog/20070512-ssl.png" /></div>

Now you are secure and ready to rock.]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to generate a self-signed SSL cert for Apache Tomcat 5.5 on my Ubuntu Linux server. The basic process is to create a Java keystore with the self-signed cert, change Tomcat&#8217;s configuration file, and restart the server. Here&#8217;s how I did it:</p>
<pre class="brush: plain; title: ;">
$ keytool -genkey -alias tomcat -keyalg RSA -keystore mycert.jks
Enter keystore password:  changeit
What is your first and last name?
  [Unknown]:  Chris Barber
What is the name of your organizational unit?
  [Unknown]:
What is the name of your organization?
  [Unknown]:  CB1, INC.
What is the name of your City or Locality?
  [Unknown]:  Minneapolis
What is the name of your State or Province?
  [Unknown]:  MN
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=Chris Barber, OU=Unknown, O=&quot;CB1, INC.&quot;, L=Minneapolis, ST=MN, C=US correct?
  [no]:  yes

Enter key password for &lt;tomcat&gt;
        (RETURN if same as keystore password):
</pre>
<p>By default, Tomcat will assume the password as &#8220;changeit&#8221;.  You can change the password, but then you need to set the keystorePass in Tomcat&#8217;s configuration file. Regardless, the password for both the keystore and the cert MUST be the same.  Store the keystore in a safe place such as Tomcat&#8217;s configuration folder:</p>
<pre class="brush: plain; title: ;">
/etc/tomcat5.5
</pre>
<p>Next edit Tomcat&#8217;s server configuration file:</p>
<pre class="brush: plain; title: ;">
/etc/tomcat5.5/server.xml
</pre>
<p>Locate the SSL connector declaration, uncomment it, and add the keystoreFile path:</p>
<pre class="brush: plain; title: ;">
&lt;!-- Define a SSL HTTP/1.1 Connector on port 8443 --&gt;
&lt;Connector port=&quot;8443&quot; maxHttpHeaderSize=&quot;8192&quot;
        maxThreads=&quot;150&quot; minSpareThreads=&quot;25&quot; maxSpareThreads=&quot;75&quot;
        enableLookups=&quot;false&quot; disableUploadTimeout=&quot;true&quot;
        acceptCount=&quot;100&quot; scheme=&quot;https&quot; secure=&quot;true&quot;
        keystoreFile=&quot;/etc/tomcat5.5/mycert.jks&quot;
        clientAuth=&quot;false&quot; sslProtocol=&quot;TLS&quot; /&gt;
</pre>
<p>Save the changes and restart Tomcat:</p>
<pre class="brush: plain; title: ;">
$ sudo /etc/init.d/tomcat5.5 restart
</pre>
<p>You should be good to go at this point. Launch your <a href="http://www.mozilla.com" target="_blank">favorite web browser</a> and go to https://localhost:8443.</p>
<div align="center"><img alt="SSL dialog" src="/wp-content/uploads/2009/12/20070512-ssl1.png" /></div>
<p>Now you are secure and ready to rock.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/05/12/creating-self-signed-certs-on-apache-tomcat-5-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

