<?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>Debian Tutorials &#187; openssl</title>
	<atom:link href="http://www.debiantutorials.com/tag/openssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian Linux</description>
	<lastBuildDate>Wed, 18 Aug 2010 00:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create your private certificate authority (CA)</title>
		<link>http://www.debiantutorials.com/create-your-private-certificate-authority-ca/</link>
		<comments>http://www.debiantutorials.com/create-your-private-certificate-authority-ca/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:54:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://debiantutorials.net/create-your-private-certificate-authority-ca/</guid>
		<description><![CDATA[Creating a private CA can be useful if you have a lot of services encrypting data for internal use but don't need the domain to be verified by a public CA like Verisign, Thawte etc. By importing the CA to all computers that will use these services users won't get the a popup in IE [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a private CA can be useful if you have a lot of services encrypting data for internal use but don't need the domain to be verified by a public CA like Verisign, Thawte etc. By importing the CA to all computers that will use these services users won't get the a popup in IE and Firefox saying that the certificate is invalid.</p>
<p><strong>1. Create a CA certificate</strong></p>
<p>Create a private key for your CA:</p>
<p><code>openssl genrsa -des3 -out ca.key 4096<br />
</code></p>
<p><span id="more-15"></span><em>You will need to enter passphrase, this password will be used everytime you sign a certificate with this CA</em></p>
<p>Make sure unauthorized users don't get access to your private key:</p>
<p><code>chmod 700 ca.key<br />
</code></p>
<p>Create the certificate, this will be shown as the top level certificate when you have signed other certificates so choose expiration day and the certificate contents carefully. All signed certificates will expirate if the top level certificate expires so you may want to choose a few years here</p>
<p><code>openssl req -new -x509 -days 3650 -key ca.key -out ca.crt<br />
</code></p>
<p>Here is a sample of input values:</p>
<p><code>Enter pass phrase for ca.key:<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [AU]:US<br />
State or Province Name (full name) [Some-State]:<br />
Locality Name (eg, city) []:<br />
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Debian Tutorials<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, YOUR name) []:Debian Tutorials CA<br />
Email Address []:<br />
</code></p>
<p><em>Common name will be shown when users are displaying details about the certificate</em></p>
<p><strong>2. Create a certificate request</strong></p>
<p>Create a private key:</p>
<p><code>openssl genrsa -des3 -out secure.debiantutorials.net.key 4096<br />
</code></p>
<p>Replace secure.debiantutorials.net by your domain name</p>
<p>Create the certificate request</p>
<p><code>openssl req -new -key secure.debiantutorials.net.key -out secure.debiantutorials.net.csr<br />
</code></p>
<p><em>Make sure you put your domain name in the "Common Name" field</em></p>
<p><strong>3. Sign the certificate with your CA certificate</strong></p>
<p>You will need to provide the certificate request here and the CA key</p>
<p><code>openssl x509 -req -days 365 -in secure.debiantutorials.net.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out secure.debiantutorials.net.crt<br />
</code></p>
<p>4. Remove password from key (optional)</p>
<p>If using the certificate with Apache, Postfix or other services you may need to replace the password in your private key so that the service can start without user interaction</p>
<p><code>openssl rsa -in secure.debiantutorials.net.key -out secure.debiantutorials.net.key.insecure<br />
mv secure.debiantutorials.net.key secure.debiantutorials.net.key.secure<br />
mv secure.debiantutorials.net.key.insecure secure.debiantutorials.net.key</code></p>
<p>Set permissions on the keys</p>
<p><code>chmod 700 secure.debiantutorials.net.key<br />
chmod 700 secure.debiantutorials.net.key.secure<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/create-your-private-certificate-authority-ca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Request and install SSL using Apache2 and OpenSSL</title>
		<link>http://www.debiantutorials.com/request-and-install-ssl-using-apache2-and-openssl/</link>
		<comments>http://www.debiantutorials.com/request-and-install-ssl-using-apache2-and-openssl/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 23:27:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://debiantutorials.net/request-and-install-ssl-using-apache2-and-openssl/</guid>
		<description><![CDATA[First we'll need to create a certificate signing request (CSR) containing the certificate application info and a private key. Make sure you don't expose you're private key (test.com.key) to the public or the safety of the encrypted information could be compromised.
mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
openssl req -new -nodes -keyout test.com.key -out test.com.csr

Answer the questions with information about [...]]]></description>
			<content:encoded><![CDATA[<p>First we'll need to create a certificate signing request (CSR) containing the certificate application info and a private key. Make sure you don't expose you're private key (test.com.key) to the public or the safety of the encrypted information could be compromised.</p>
<p><code>mkdir /etc/apache2/ssl<br />
cd /etc/apache2/ssl<br />
openssl req -new -nodes -keyout test.com.key -out test.com.csr<br />
</code><span id="more-9"></span></p>
<p>Answer the questions with information about you/your company and the domain that will be validated. Make sure you use a fully qualified domain name (FQDN) in the common name section. When the certificate has been issued you can access the encrypted web by visiting https://FQDN. You can safely skip the extra attributes.</p>
<p>Now you can submit the CSR to your favorite certificate authority for validation. test.com.csr should read something like this (pico test.com.csr):</p>
<p><code>-----BEGIN CERTIFICATE REQUEST-----<br />
MIIB1jCCAT8CAQAwgZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRl<br />
MRAwDgYDVQQHEwdNeSBjaXR5MSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0<br />
eSBMdGQxCzAJBgNVBAsTAklUMREwDwYDVQQDEwh0ZXN0LmNvbTEcMBoGCSqGSIb3<br />
DQEJARYNdGVzdEB0ZXN0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA<br />
vE4BTEVYiRKvAxQToVIg7q5BsdyxgLNwSURwvpK71+mOv21/A5D5svfMNVWC7djv<br />
offcbN7WeHChBOJPBUxsOIuE5oF3/PAXRIcEDA5v3felPz6Dx0Z8NwbDfjpBjgJZ<br />
e1H82Qki17Eue+RhNUG/y3Te3PwWjFBwKGbeYdi/GpECAwEAAaAAMA0GCSqGSIb3<br />
DQEBBQUAA4GBAG5HIpwL5LhMfMEm7rEZKpCs/nplT57eEd5O3vXE72CQIom5oKTz<br />
0PrpIrdzBdWM3B9sKNRKi/wl0TkkOEsDrq9HMe9WmnM6k8pjLYVUpdhuwhorBwyv<br />
8E/Men1hbqDXckDeVU8ZdrZ2OJuCu/iuuMoGFcAco9kuK7mZM286IqjI<br />
-----END CERTIFICATE REQUEST-----<br />
</code></p>
<p>Here is a short list of popular certificate authorities:</p>
<p><a href="http://www.verisign.com">Verisign</a><br />
<a href="http://www.thawte.com">Thawte</a><br />
<a href="http://www.globalsign.com">GlobalSign</a><br />
<a href="http://www.comodo.com">Comodo</a></p>
<p>When you have received your certificate from your certificate authority we'll need to enable it in Apache. Create a file that will contain the certificate and paste your new certificate (pico test.com.crt):</p>
<p><code>-----BEGIN CERTIFICATE-----<br />
MIAGCSqGSIb3DQEHAqCAMIACAQExADALBgkqhkiG9w0BBwGggDCCAAhAF<br />
UbM77e50M63v1Z2A/5O5MA0GCSqGSIb3DQEOBAUAMF8xCzAJBgNlVTMSAw<br />
(.......)<br />
E+cFEpf0WForA+eRP6XraWw8rTN8102zGrcJgg4P6XVS4l39+l5aCEGGbauLP5W6<br />
K99c42ku3QrlX2+KeDi+xBG2cEIsdSiXeQS/16S36ITclu4AADEAAAAAAAAA<br />
-----END CERTIFICATE-----<br />
</code></p>
<p>Make sure the certificate and private key are only readable by root:</p>
<p><code>chmod 400 test.com.key test.com.crt<br />
</code></p>
<p>Download the CA root certificate. You can find CA certificates for the authorities mentioned above here:</p>
<p>Verisign -&gt; http://www.verisign.com/support/verisign-intermediate-ca/<br />
Thawte -&gt; http://www.thawte.com/roots/index.html<br />
Globalsign -&gt; http://secure.globalsign.net/cacert/<br />
Comodo -&gt; https://support.comodo.com/index.php?_m=downloads&amp;_a=view&amp;parentcategoryid=1&amp;pcid=0&amp;nav=0</p>
<p>In this example we'll download RapidSSL CA certificate:</p>
<p><code>wget http://www.rapidssl.com/cps/rapidssl_01.cer<br />
</code></p>
<p>Configure apache to use this certificate to encrypt data (pico /etc/apache2/sites-enabled/000-default). Add these lines somewhere outside your Virtualhost entry:</p>
<p><code>&lt;VirtualHost {ipaddress}:443&gt;<br />
DocumentRoot {docroot}<br />
SSLEngine on<br />
SSLCertificateFile /etc/apache2/ssl/test.com.crt<br />
SSLCertificateKeyFile /etc/apache2/ssl/test.com.key<br />
SSLCACertificateFile /etc/apache2/ssl/rapidssl_01.cer<br />
&lt;/VirtualHost&gt;<br />
</code></p>
<p>Restart apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
<p>Now you should be able to access https://FQDN.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/request-and-install-ssl-using-apache2-and-openssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
