<?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>Too Far Afield &#187; ssl</title>
	<atom:link href="http://blog.nachtarbeiter.net/tag/ssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nachtarbeiter.net</link>
	<description></description>
	<lastBuildDate>Mon, 09 Jan 2012 05:41:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting rid of Apache pass-phrase dialogs</title>
		<link>http://blog.nachtarbeiter.net/2009/08/20/getting-rid-of-apache-pass-phrase-dialogs/</link>
		<comments>http://blog.nachtarbeiter.net/2009/08/20/getting-rid-of-apache-pass-phrase-dialogs/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 06:14:51 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://blog.nachtarbeiter.net/?p=832</guid>
		<description><![CDATA[Throughout the internet, HTTPS is used to encrypt traffic between a web server and its clients and thus provide a secure way of communicating with a server. Unfortunately, the best encryption is (somewhat) worthless, if you can&#8217;t be 100 percent sure that you are communicating with the right server. If Alice wants to send her [...]]]></description>
			<content:encoded><![CDATA[<p>Throughout the internet, <abbr title="Hypertext Transfer Protocol Secure">HTTPS</abbr> is used to encrypt traffic between a web server and its clients and thus provide a secure way of communicating with a server. Unfortunately, the best encryption is (somewhat) worthless, if you can&#8217;t be 100 percent sure that you are communicating with the right server. If <a href="http://en.wikipedia.org/wiki/Alice_and_Bob">Alice</a> wants to send her credit card number to Bob, all encryption is worthless, if Mallory can trick her into thinking that he is Bob. <abbr title="Secure Sockets Layer">SSL</abbr> certificates to the rescue. If Alice trusts Carol and Carol has issued a <abbr title="Secure Sockets Layer">SSL</abbr> certificate to Bob, Alice can be sure that Bob is actually Bob and not someone else. <abbr title="Secure Sockets Layer">SSL</abbr> certificates are usually protected by private keys. You need the private key to use the <abbr title="Secure Sockets Layer">SSL</abbr> certificate. These private keys are usually encrypted with a pass-phrase. If Mallory manages to compromise Bobs server and steal the private key file, he can not (mis-)use it, because it is encrypted. That&#8217;s the theory.</p>
<p>However, Bobs web server needs to read the private key file to utilize the <abbr title="Secure Sockets Layer">SSL</abbr> certificate. If it is encrypted, Bob has to either store the pass-phrase somewhere or enter it by hand every time he starts the web server. If Bob uses <cite>Apache</cite>, he will get a so-called pass-phrase dialog. By default it looks like this (on the command line):  </p>
<ol class="code">
<li><code>https-www:/etc/apache2-itk/# /etc/init.d/apache2-itk start</code></li>
<li><code>Some of your private key files are encrypted for security reasons.</code></li>
<li><code>In order to read them you have to provide the pass phrases.</code></li>
<li><code> </code></li>
<li><code>Server secure.example.org:443 (RSA)</code></li>
<li><code>Enter pass phrase:</code></li>
<li><code> </code></li>
<li><code>OK: Pass Phrase Dialog successful.</code></li>
<li><code>.</code></li>
</ol>
<p>While entering the pass-phrase of an <abbr title="Secure Sockets Layer">SSL</abbr> certificate by hand is a very secure approach, it has its share of problems:</p>
<ul>
<li>Upon reboot of Bobs server, the web server will not start automatically. It will hang, because it waits for the pass-phrase to be entered. Likewise, if the web server is restarted automatically for some reason (e.g. by monitoring software) the web server will hang on start-up, because it waits for the pass-phrase to be entered.</li>
<li>For security reasons, it is unwise to use the same pass-phrase for all private keys. Also, Bob shouldn&#8217;t use overly simple pass-phrases, that are easy to remember. If Bob needs tenths (or even hundreds) of private keys he can&#8217;t possibly remember every single pass-phrase.</li>
<li>It takes some time until Bob has looked up the corresponding pass-phrase in his mind or in his secure pass-phrase store. Even if he manages to immediately know every pass-phrase in use at his web server, it takes some time until he has entered the pass-phrase.</li>
</ul>
<p>For the sacrifice of some security, you can mitigate these issues. If you really don&#8217;t care much for security, you can either not use a pass-phrase in the first place or &#8211; if you somehow entered a pass-phrase by accident &#8211; remove the pass-phrase from the key file. To remove the pass-phrase from an <abbr title="Rivest Shamir Adleman encryption algorithm">RSA</abbr> private key use:</p>
<ol class="code">
<li><code>openssl rsa -in secure.example.org-2009.key -out secure.example.org-2009.key.unprotected</code></li>
</ol>
<p>If you want a somewhat more secure approach (depending on the implementation), you can check out the <a href="http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslpassphrasedialog"><code>SSLPassPhraseDialog</code> directive</a> of the <cite>Apache</cite> <code>mod_ssl</code> module. Using this directive, you can tell <cite>Apache</cite> to ask an external script for the pass-phrase of your certificates:</p>
<ol class="code">
<li><code>SSLPassPhraseDialog exec:/path/to/script</code></li>
</ol>
<p><cite>Apache</cite> will supply two arguments to the script. The first argument is of the form <code>servername:portnumber</code>, e.g. <code>secure.example.org:443</code> and the second argument is either <code>RSA</code> or <code>DSA</code>. The script would print the corresponding pass-phrase to <code>stdout</code>. Of course, you still need to store the pass-phrases somewhere. How much security you sacrifice using this construct depends on the implementation of your external script. But it might be a slight bit more secure than just using no pass-phrase for the private key files at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nachtarbeiter.net/2009/08/20/getting-rid-of-apache-pass-phrase-dialogs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

