<?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; tomcat</title>
	<atom:link href="http://www.cb1inc.com/category/tomcat/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>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>

