<?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>Bits of Arrogance &#187; vpn</title>
	<atom:link href="https://www.crummylogic.com/wordpress/?feed=rss2&#038;tag=vpn" rel="self" type="application/rss+xml" />
	<link>https://www.crummylogic.com/wordpress</link>
	<description>Making myself pervasive</description>
	<lastBuildDate>Wed, 04 Oct 2017 17:25:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.4</generator>
	<item>
		<title>Adito Security Certificate &#8211; Pain in the butt, but possible</title>
		<link>https://www.crummylogic.com/wordpress/?p=145</link>
		<comments>https://www.crummylogic.com/wordpress/?p=145#comments</comments>
		<pubDate>Tue, 10 Dec 2013 18:18:38 +0000</pubDate>
		<dc:creator><![CDATA[jrdalrymple]]></dc:creator>
				<category><![CDATA[Technology junk]]></category>
		<category><![CDATA[adito]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl certificate]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.jrssite.com/wordpress/?p=145</guid>
		<description><![CDATA[Adito (formerly OpenVPN-ALS) is an amazingly wonderful piece of software. Honestly I can&#8217;t figure out why more FOSS advocates don&#8217;t pick up the pieces of the project and continue to develop on it. I guess largely it does what it&#8217;s supposed to do and doesn&#8217;t need much in the way of updating, though it would &#8230; <a href="https://www.crummylogic.com/wordpress/?p=145" class="more-link">Continue reading <span class="screen-reader-text">Adito Security Certificate &#8211; Pain in the butt, but possible</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Adito (formerly OpenVPN-ALS) is an amazingly wonderful piece of software. Honestly I can&#8217;t figure out why more FOSS advocates don&#8217;t pick up the pieces of the project and continue to develop on it. I guess largely it does what it&#8217;s supposed to do and doesn&#8217;t need much in the way of updating, though it would be nice if the plugin repositories were still up and running and such.</p>
<p>That said, I run Adito in 3 locations. For 2 of my locations the self-signed server certificate Adito creates and installs during the setup wizard is adequate. For 1 location though I prefer to offer the appearance of a truly secure and trusted site.</p>
<p>I&#8217;ll start by sharing the links I had to visit and inquire with to make all this work in case my write-up falls short for anyone reading it:</p>
<p><a href="http://sourceforge.net/p/openvpn-als/discussion/824507/thread/3e62506d">Discussion Topic on Sourceforge page</a></p>
<p><a href="http://www.agentbob.info/agentbob/79-AB.html">Instructions and discussion &#8211; Import private key and certificate into Java Key Store from</a> agentbob.info</p>
<p><a href="https://github.com/sschober/ImportKey">Github page for importkey tool that I used</a></p>
<p>I perused many many other pages, but these 3 gave me all the parts I needed to complete my task.</p>
<p>The server tools you&#8217;ll need will be openssl and jdk which you&#8217;ll have as a prerequisite to adito.</p>
<p>My installation is performed on CentOS 6.3 with Java jdk 1.7.0 u13. If any of the command I tell you to issue below don&#8217;t work it&#8217;s probably because your path is broken to java binaries.</p>
<p>It helps to create a working directory on your server so that all your files are glommed together in one place and not mixed in with other junk. Before you finish there will be quite a collection.</p>
<p>Step one &#8211; create your private key and certificate request:</p>
<pre>openssl req -out fqdn.csr -new -newkey rsa:2048 -nodes -keyout fqdn.key</pre>
<p style="padding-left: 30px;"><em>As a sidenote, if you compare this documentation with that of the folks on the Sourceforge discussion bored you&#8217;ll see that I skipped one of their steps. I&#8217;m fairly certain the `openssl req -x509` business is unnecessary. If someone can prove me wrong please let me know and I&#8217;ll update this documentation to reflect that.</em></p>
<p>Step two &#8211; submit your CSR (fqdn.csr from above) to the company you wish to issue you a certificate, follow their instructions to get your 3rd party trusted cert. In my case I was provided with 3 certificates in return, the one signed against my CSR, an intermediate and a root. Making note of what they need bundled together to form a valid chain is going to be important, and it will be different for each company. Put your fqdn.crt, intermediate.crt and root.crt into your working folder.</p>
<p>Step three &#8211; Convert all of your PEM formatted .crt files into DER format:</p>
<pre>for cert in fqdn.crt intermediate.crt root.crt; do openssl x509 -in $cert -inform PEM -out cert.der -outform DER; done</pre>
<p>Step four &#8211; Convert your private key to DER format as well:</p>
<pre>openssl pkcs8 -topk8 -nocrypt -in fqdn.key -inform PEM -out fqdn.key.der -outform DER</pre>
<p>Step five &#8211; cat the certificates together. I&#8217;m not sure if order matters, but I did it from my cert back to the root and that worked:</p>
<pre>cat fqdn.crt.der intermediate.crt.der root.crt.der &gt; fqdn.bundle.crt.der</pre>
<p>Step six &#8211; Copy the <a href="http://www.agentbob.info/agentbob/80/version/default/part/AttachmentData/data/ImportKey.java">ImportKey.java source</a> to your machine. You can just click on the link either here or from the agentbob.info link above and copy/paste the source into a text editor on your server. I had to make a change in the source (following the advice of somebody else who had a similar problem and posted the solution in the agentbob.info article&#8217;s comments) in order for the tool to work with chained/bundled certificates. I&#8217;ve created a <a href="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/ImportKey.java.diff">diff </a>to use to patch said source, you can also just copy and paste it into your text editor.</p>
<pre>patch ImportKey.java ImportKey.java.diff</pre>
<p>Step seven &#8211; Compile and run the ImportKey application:</p>
<p>javac ImportKey.java</p>
<p>java ImportKey fqdn.key.der fqdn.bundle.crt.der</p>
<p>Note that the resulting keystore file is going to be in your home directory, so if you&#8217;re running as root it will be /root/keystore.ImportKey. It has the alias &#8220;importkey&#8221; as well as the keystore password &#8220;importkey&#8221;; CHANGE IT:</p>
<p>Step eight &#8211; change the keystore password for your keystore:</p>
<pre>keytool -importkeystore -srckeystore /root/keystore.ImportKey -destkeystore importkey.jks</pre>
<p>When running the above command you&#8217;ll be asked to issue the new keystore password &#8211; do it. It will eventually ask you for the source keystore password, as mentioned above that password is &#8220;importkey&#8221;.</p>
<p>If your adito server doesn&#8217;t have a web browser you need to get the file to a machine that does have a web browser, as it&#8217;s through the web interface that we&#8217;ll be importing the newly created keystore &#8211; do that now.</p>
<p>Step nine &#8211; rerun `ant install`from your adito installation directory, if your adito server is currently running, stop it:</p>
<pre>cd /opt/adito0.9.1
/etc/init.d/adito stop
ant install</pre>
<p>Step nine, part 2 &#8211; When you get to the bit about &#8220;Starting installation wizard&#8230;&#8230;&#8230;.Point your browser to http://aditoserver:28080&#8243; do just that. There will be 2 screens to be concerned with:</p>
<p>Select &#8220;Import Existing Certificate&#8221; on the first screen.</p>
<p>&nbsp;</p>
<p><a href="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-1.jpg"><img class="alignnone size-medium wp-image-148" alt="step 1" src="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-1-300x197.jpg" width="300" height="197" /></a></p>
<p>&nbsp;</p>
<p>Fill in all the pertinent information on the following screen. (ignore my typo please)</p>
<p><a href="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-2.jpg"><img class="alignnone size-medium wp-image-149" alt="step 2" src="http://www.jrssite.com/wordpress/wp-content/uploads/2013/12/step-2-300x197.jpg" width="300" height="197" /></a></p>
<p>The remaining install screens should remember your settings from the prior install. If this is your first time running `ant install`, configure according to your needs.</p>
<p>When finished issue an adito start command:</p>
<pre>/etc/init.d/adito start</pre>
<p>And you should be finished. Open your adito site in a browser and verify your new certificate is installed and being presented.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.crummylogic.com/wordpress/?feed=rss2&#038;p=145</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
