<?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>langui.sh &#187; openssl</title>
	<atom:link href="http://langui.sh/tag/openssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://langui.sh</link>
	<description>Fun hacks, WP plugins, photography, and PKI junk.  Languishing since 2008.</description>
	<lastBuildDate>Tue, 17 Jan 2012 20:23:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>r509 v0.5</title>
		<link>http://langui.sh/2011/12/27/r509-v0-5/</link>
		<comments>http://langui.sh/2011/12/27/r509-v0-5/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 04:01:50 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[r509]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1542</guid>
		<description><![CDATA[<a href="http://langui.sh/2011/12/27/r509-v0-5/" title="r509 v0.5"></a>I haven&#8217;t talked about r509 here in awhile, but since v0.5 just got tagged I thought I&#8217;d plug it again. r509 is a wrapper for the OpenSSL libraries in Ruby. It&#8217;s designed to allow you to do a wide variety &#8230;<p class="read-more"><a href="http://langui.sh/2011/12/27/r509-v0-5/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2011/12/27/r509-v0-5/" title="r509 v0.5"></a><p>I haven&#8217;t talked about <a href="http://r509.org">r509</a> here in awhile, but since v0.5 just got tagged I thought I&#8217;d plug it again. r509 is a wrapper for the OpenSSL libraries in Ruby. It&#8217;s designed to allow you to do a wide variety of certificate authority related operations (issuance, revocation, CRL generation, OCSP responses, et cetera). There are also some ancillary gems that are under active development (<a href="https://github.com/sirsean/r509-ca-http">r509-ca-http</a>, <a href="https://github.com/reaperhulk/r509-ocsp-responder">r509-ocsp-responder</a>, <a href="https://github.com/sirsean/r509-validity-redis">r509-validity-redis</a>) which will gain more documentation as these projects progress.</p>
<p>Check it out, file issues, fork, and contribute!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/12/27/r509-v0-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby OpenSSL::X509::Name#to_a Dissection</title>
		<link>http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/</link>
		<comments>http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 21:54:31 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1559</guid>
		<description><![CDATA[<a href="http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/" title="Ruby OpenSSL::X509::Name#to_a Dissection"></a>Over at Viking Hammer my coworker Sean Schulte has written up a great article dissecting an issue we ran into regarding the way Ruby&#8217;s OpenSSL::X509::Name#to_a currently builds its array. He discusses the problem, the two solutions we came up with, &#8230;<p class="read-more"><a href="http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/" title="Ruby OpenSSL::X509::Name#to_a Dissection"></a><p>Over at <a href="http://vikinghammer.com">Viking Hammer</a> my coworker Sean Schulte has written up a <a href="http://vikinghammer.com/2011/12/21/ruby-opensslx509name-throws-away-unknown-subject-component-names/">great article</a> dissecting an issue we ran into regarding the way Ruby&#8217;s OpenSSL::X509::Name#to_a currently builds its array. He discusses the problem, the two solutions we came up with, and shares code examples. Go check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>r509, Ruby CA</title>
		<link>http://langui.sh/2011/03/31/r509-ruby-ca/</link>
		<comments>http://langui.sh/2011/03/31/r509-ruby-ca/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 18:52:46 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1476</guid>
		<description><![CDATA[<a href="http://langui.sh/2011/03/31/r509-ruby-ca/" title="r509, Ruby CA"></a>I&#8217;ve put a new project up on Github. r509 is a CA written in Ruby which aims to do friendly wrapping around Ruby&#8217;s baroque OpenSSL bindings. It&#8217;s still in the early stages, but check it out if you&#8217;re interested and &#8230;<p class="read-more"><a href="http://langui.sh/2011/03/31/r509-ruby-ca/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2011/03/31/r509-ruby-ca/" title="r509, Ruby CA"></a><p>I&#8217;ve put a new project up on Github. <a href="https://github.com/reaperhulk/r509">r509</a> is a CA written in Ruby which aims to do friendly wrapping around Ruby&#8217;s baroque OpenSSL bindings. It&#8217;s still in the early stages, but check it out if you&#8217;re interested and fork if you want to help it improve!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/03/31/r509-ruby-ca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OCSP Queries Via OpenSSL</title>
		<link>http://langui.sh/2010/11/20/ocsp-queries-via-openssl/</link>
		<comments>http://langui.sh/2010/11/20/ocsp-queries-via-openssl/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 18:24:11 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[ocsp]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=955</guid>
		<description><![CDATA[<a href="http://langui.sh/2010/11/20/ocsp-queries-via-openssl/" title="OCSP Queries Via OpenSSL"></a>OpenSSL has an ocsp querying facility that can be useful if you&#8217;re testing a responder or just curious how the online certificate status protocol works. To use it: openssl ocsp -issuer IssuingCert.txt -cert ServerCert.txt -url http://ocsp.wherever.com -CAfile CAchain.txt Argument Breakdown &#8230;<p class="read-more"><a href="http://langui.sh/2010/11/20/ocsp-queries-via-openssl/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2010/11/20/ocsp-queries-via-openssl/" title="OCSP Queries Via OpenSSL"></a><p>OpenSSL has an ocsp querying facility that can be useful if you&#8217;re testing a responder or just curious how the online certificate status protocol works.  To use it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl ocsp <span style="color: #660033;">-issuer</span> IssuingCert.txt <span style="color: #660033;">-cert</span> ServerCert.txt <span style="color: #660033;">-url</span> http:<span style="color: #000000; font-weight: bold;">//</span>ocsp.wherever.com <span style="color: #660033;">-CAfile</span> CAchain.txt</pre></div></div>

<h3>Argument Breakdown</h3>
<ul>
<li>-issuer is the issuing CA for the certificate you want to check (called IssuingCert.txt above).  This can be a self-signed root or a subroot. </li>
<li>-cert is the certificate you want to verify.  If you know the serial number and don&#8217;t want to provide the cert file itself you can use -serial instead.</li>
<li>-url is the URL of the OCSP responder for your cert.  You can parse the certificate to find the end point.  It will be under the Authority Information Access node inside the x509 extensions</li>
<li>-CAfile is only required if you want to verify the response of the OCSP server.<sup class='footnote'><a href='#fn-955-1' id='fnref-955-1'>1</a></sup> You&#8217;ll need to place the self-signed root + whatever intermediates are necessary for the OCSP signing cert from the server to chain up to it.</li>
<li>There are many other optional args, so check out the list just by typing &#8220;openssl ocsp&#8221;</li>
</ul>
<h3>OCSP Response</h3>
<p>Here&#8217;s an example response where the certificate has been marked as revoked.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">Response verify OK
ServerCert.txt: revoked
This Update: Nov 20 15:43:49 2010 GMT
Next Update: Dec  4 17:43:49 2010 GMT
Reason: unspecified
Revocation Time: Mar 31 21:37:52 2009 GMT</pre></div></div>

<p>And one marked as acceptable.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">Response verify OK
ServerCert.txt: good
This Update: Nov 20 11:20:51 2010 GMT
Next Update: Nov 27 11:20:51 2010 GMT</pre></div></div>

<p>Responses can have several error status codes.  Here&#8217;s the list of possible errors from <a href="http://www.ietf.org/rfc/rfc2560.txt">RFC 2560</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">malformedRequest      (1),  --Illegal confirmation request
internalError         (2),  --Internal error in issuer
tryLater              (3),  --Try again later
                            --(4) is not used
sigRequired           (5),  --Must sign the request
unauthorized          (6)   --Request unauthorized</pre></div></div>

<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-955-1'>If you don&#8217;t want to verify, use -noverify <span class='footnotereverse'><a href='#fnref-955-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2010/11/20/ocsp-queries-via-openssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parsing A CRL With OpenSSL</title>
		<link>http://langui.sh/2010/01/10/parsing-a-crl-with-openssl/</link>
		<comments>http://langui.sh/2010/01/10/parsing-a-crl-with-openssl/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 02:29:47 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[crl]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=952</guid>
		<description><![CDATA[<a href="http://langui.sh/2010/01/10/parsing-a-crl-with-openssl/" title="Parsing A CRL With OpenSSL"></a>Short and sweet. This command will parse and give you a list of revoked serial numbers: openssl crl -inform DER -text -noout -in mycrl.crl Most CRLs are DER encoded, but you can use -inform PEM if your CRL is not &#8230;<p class="read-more"><a href="http://langui.sh/2010/01/10/parsing-a-crl-with-openssl/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2010/01/10/parsing-a-crl-with-openssl/" title="Parsing A CRL With OpenSSL"></a><p>Short and sweet.  This command will parse and give you a list of revoked serial numbers:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl crl <span style="color: #660033;">-inform</span> DER <span style="color: #660033;">-text</span> <span style="color: #660033;">-noout</span> <span style="color: #660033;">-in</span> mycrl.crl</pre></div></div>

<p>Most CRLs are DER encoded, but you can use -inform PEM if your CRL is not binary.  If you&#8217;re unsure if it is DER or PEM open it with a text editor.  If you see &#8212;&#8211;BEGIN X509 CRL&#8212;&#8211; then it&#8217;s PEM and if you see strange binary-looking garbage characters it&#8217;s DER.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2010/01/10/parsing-a-crl-with-openssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSSL and IDN Certificates</title>
		<link>http://langui.sh/2010/01/03/openssl-and-idn-certificates/</link>
		<comments>http://langui.sh/2010/01/03/openssl-and-idn-certificates/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 17:34:46 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[idn]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=946</guid>
		<description><![CDATA[<a href="http://langui.sh/2010/01/03/openssl-and-idn-certificates/" title="OpenSSL and IDN Certificates"></a>As internationalized domain names (IDN) proliferate more people need to test with, and ultimately purchase, IDN certificates. If you need to generate a CSR or even a self-signed certificate for an internationalized domain follow these steps: Take the UTF-8 characters &#8230;<p class="read-more"><a href="http://langui.sh/2010/01/03/openssl-and-idn-certificates/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2010/01/03/openssl-and-idn-certificates/" title="OpenSSL and IDN Certificates"></a><p>As internationalized domain names (IDN) proliferate more people need to test with, and ultimately purchase, IDN certificates.  If you need to generate a CSR or even a self-signed certificate for an internationalized domain follow these steps:</p>
<ol>
<li>Take the UTF-8 characters and paste them into a <a href="http://idnaconv.phlymail.de/" target="_blank">punycode converter</a> (also known as ASCII compatible encoding, or ACE).</li>
<li>The resulting converted text will be a fairly long string that starts with &#8220;xn--&#8221;.  Copy the entire thing.</li>
<li>Now run this command.</li>
</ol>
<p>For CSR generation<sup class='footnote'><a href='#fn-946-1' id='fnref-946-1'>1</a></sup>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-out</span> mycsr.csr <span style="color: #660033;">-keyout</span> mykey.pem <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">2048</span></pre></div></div>

<p>For self-signed certificate generation<sup class='footnote'><a href='#fn-946-2' id='fnref-946-2'>2</a></sup>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span> <span style="color: #660033;">-out</span> mycert.cer <span style="color: #660033;">-keyout</span> mykey.pem <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">2048</span></pre></div></div>

<p>Either way, follow the prompts and when you reach Common Name paste the text you copied from the punycode converter.  Now you can submit your CSR to a certification authority or install the self-signed certificate for testing.</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-946-1'>We are generating a <a href="/2009/10/31/create-a-2048-bit-key-via-openssl/">2048-bit CSR</a> <span class='footnotereverse'><a href='#fnref-946-1'>&#8617;</a></span></li>
<li id='fn-946-2'>This will generate a 10 year self-signed certificate. <span class='footnotereverse'><a href='#fnref-946-2'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2010/01/03/openssl-and-idn-certificates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find A Matching Certificate And Key Pair</title>
		<link>http://langui.sh/2009/11/08/find-a-matching-certificate-and-key-pair/</link>
		<comments>http://langui.sh/2009/11/08/find-a-matching-certificate-and-key-pair/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 02:49:21 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=806</guid>
		<description><![CDATA[<a href="http://langui.sh/2009/11/08/find-a-matching-certificate-and-key-pair/" title="Find A Matching Certificate And Key Pair"></a>If you have a list of keys and SSL certs and don&#8217;t know which cert belongs with which key, here&#8217;s a script for you. It&#8217;s not efficient (nested for loop!), but it gets the job done quickly.1 #!/bin/bash for i &#8230;<p class="read-more"><a href="http://langui.sh/2009/11/08/find-a-matching-certificate-and-key-pair/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2009/11/08/find-a-matching-certificate-and-key-pair/" title="Find A Matching Certificate And Key Pair"></a><p>If you have a list of keys and SSL certs and don&#8217;t know which cert belongs with which key, here&#8217;s a script for you.  It&#8217;s not efficient (nested for loop!), but it gets the job done quickly.<sup class='footnote'><a href='#fn-806-1' id='fnref-806-1'>1</a></sup></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.key<span style="color: #000000; font-weight: bold;">`</span> 
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #007800;">key_mod</span>=<span style="color: #000000; font-weight: bold;">`</span>openssl rsa <span style="color: #660033;">-noout</span> <span style="color: #660033;">-in</span> <span style="color: #007800;">$i</span> -modulus<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">for</span> j <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.cer<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #007800;">x509_mod</span>=<span style="color: #000000; font-weight: bold;">`</span>openssl x509 <span style="color: #660033;">-noout</span> <span style="color: #660033;">-in</span> <span style="color: #007800;">$j</span> -modulus<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$x509_mod</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">$key_mod</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$j</span> matches <span style="color: #007800;">$i</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-806-1'>If bash allowed multidimensional or associative arrays this would be trivial to optimize. <span class='footnotereverse'><a href='#fnref-806-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/11/08/find-a-matching-certificate-and-key-pair/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create A 2048-bit Key Via OpenSSL</title>
		<link>http://langui.sh/2009/10/31/create-a-2048-bit-key-via-openssl/</link>
		<comments>http://langui.sh/2009/10/31/create-a-2048-bit-key-via-openssl/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:32:37 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=741</guid>
		<description><![CDATA[<a href="http://langui.sh/2009/10/31/create-a-2048-bit-key-via-openssl/" title="Create A 2048-bit Key Via OpenSSL"></a>We are fast approaching the date where NIST has recommended that end entities stop utilizing 1024-bit private keys. OpenSSL, however, currently defaults to creating 1024-bit keypairs. To create a 2048-bit private key and corresponding CSR (which you can send to &#8230;<p class="read-more"><a href="http://langui.sh/2009/10/31/create-a-2048-bit-key-via-openssl/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2009/10/31/create-a-2048-bit-key-via-openssl/" title="Create A 2048-bit Key Via OpenSSL"></a><p>We are fast approaching the date where <a href="http://www.nist.gov">NIST</a> has recommended that end entities stop utilizing 1024-bit private keys.  OpenSSL, however, currently defaults to creating 1024-bit keypairs. To create a 2048-bit private key and corresponding CSR (which you can send to a certificate authority to obtain your SSL certificate):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">2048</span> <span style="color: #660033;">-keyout</span> mydomain.key <span style="color: #660033;">-out</span> mydomain.csr</pre></div></div>

<p>This command will make a 2048-bit key, run the interactive prompt to populate the fields of the certificate signing request, and leave the private key unencrypted (-nodes).  You can remove -nodes if you wish, but encrypting the private key will require you to type the password every time you start an application (like apache) that uses it.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/10/31/create-a-2048-bit-key-via-openssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check If A Certificate &amp; Private Key Match</title>
		<link>http://langui.sh/2009/10/05/check-if-a-certificate-private-key-match/</link>
		<comments>http://langui.sh/2009/10/05/check-if-a-certificate-private-key-match/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 14:52:30 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[x509]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=678</guid>
		<description><![CDATA[<a href="http://langui.sh/2009/10/05/check-if-a-certificate-private-key-match/" title="Check If A Certificate &amp; Private Key Match"></a>Check if an SSL certificate and private key match in two simple commands. The OpenSSL commands below will require you to replace &#60;file&#62; with your file&#8217;s name. For your SSL certificate:1 openssl x509 -noout -modulus -in &#60;file&#62; &#124; md5sum For &#8230;<p class="read-more"><a href="http://langui.sh/2009/10/05/check-if-a-certificate-private-key-match/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2009/10/05/check-if-a-certificate-private-key-match/" title="Check If A Certificate &amp; Private Key Match"></a><p>Check if an SSL certificate and private key match in two simple commands.  The OpenSSL commands below will require you to replace &lt;file&gt; with your file&#8217;s name.</p>
<p>For your SSL certificate:<sup class='footnote'><a href='#fn-678-1' id='fnref-678-1'>1</a></sup></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl x509 <span style="color: #660033;">-noout</span> <span style="color: #660033;">-modulus</span> <span style="color: #660033;">-in</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">file</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">|</span> md5sum</pre></div></div>

<p>For your RSA private key:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl rsa <span style="color: #660033;">-noout</span> <span style="color: #660033;">-modulus</span> <span style="color: #660033;">-in</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">file</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">|</span> md5sum</pre></div></div>

<p>The output of these commands should be identical.  If it isn&#8217;t, your keys do not match. </p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-678-1'>The pipe to md5sum is solely to make the output shorter and easier to visually compare <span class='footnotereverse'><a href='#fnref-678-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/10/05/check-if-a-certificate-private-key-match/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using OpenSSL s_time</title>
		<link>http://langui.sh/2009/03/28/using-openssl-s_time/</link>
		<comments>http://langui.sh/2009/03/28/using-openssl-s_time/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 20:28:28 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=431</guid>
		<description><![CDATA[<a href="http://langui.sh/2009/03/28/using-openssl-s_time/" title="Using OpenSSL s_time"></a>Recently I needed to do some performance testing of an SSL instance on a VM. I considered using JMeter, but decided to use OpenSSL to get a rudimentary picture instead. To obtain a basic result, we connect to the server &#8230;<p class="read-more"><a href="http://langui.sh/2009/03/28/using-openssl-s_time/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2009/03/28/using-openssl-s_time/" title="Using OpenSSL s_time"></a><p>Recently I needed to do some performance testing of an SSL instance on a VM.  I considered using JMeter, but decided to use OpenSSL to get a rudimentary picture instead.</p>
<p>To obtain a basic result, we connect to the server and pull the /index.php file.  You can specify whatever file you&#8217;d like to download, or none at all if you simply want to test connections.<sup class='footnote'><a href='#fn-431-1' id='fnref-431-1'>1</a></sup></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl s_time <span style="color: #660033;">-www</span> <span style="color: #000000; font-weight: bold;">/</span>index.php <span style="color: #660033;">-new</span> <span style="color: #660033;">-connect</span> www.trustwave.com:<span style="color: #000000;">443</span></pre></div></div>

<p>Your result will look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">No CIPHER specified
Collecting connection statistics for 30 seconds
ttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
159 connections in 5.82s; 27.32 connections/user sec, bytes read 62328
159 connections in 31 real seconds, 392 bytes read per connection</pre></div></div>

<p>If you&#8217;d like to get more specific with performance testing you can even use the -ciphers parameter to explicitly choose the negotiated cipher.  You can obtain a list of available ciphers with &#8220;openssl ciphers&#8221;.</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-431-1'>If you would prefer to reuse connections rather than create a new one for each request replace -new with -reuse. <span class='footnotereverse'><a href='#fnref-431-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/03/28/using-openssl-s_time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 33/77 queries in 0.027 seconds using memcached
Object Caching 1351/1428 objects using memcached

Served from: langui.sh @ 2012-02-04 13:36:03 -->
