<?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>oldmatebrendo.com &#187; certificate authority</title>
	<atom:link href="http://oldmatebrendo.com/tag/certificate-authority/feed/" rel="self" type="application/rss+xml" />
	<link>http://oldmatebrendo.com</link>
	<description>the incoherent ramblings of brendo</description>
	<lastBuildDate>Fri, 18 Sep 2009 01:02:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Java RMI Client Authentication</title>
		<link>http://oldmatebrendo.com/2008/03/java-rmi-client-authentication/</link>
		<comments>http://oldmatebrendo.com/2008/03/java-rmi-client-authentication/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 10:30:59 +0000</pubDate>
		<dc:creator>brendo</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[certificate authority]]></category>
		<category><![CDATA[client authentication]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[remote method invocation]]></category>
		<category><![CDATA[rmi]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://oldmatebrendo.com/2008/03/java-rmi-client-authentication/</guid>
		<description><![CDATA[Security is painful. My attempts to make our applet that is using RMI use SSL as well have absolutely done my head in.
First there was the fact that a self signed certificate wouldnÃ¢â‚¬â„¢t do. This wasnÃ¢â‚¬â„¢t a big surprise, but it wouldnÃ¢â‚¬â„¢t even allow me to test my app to ensure it was working before [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">Security is painful. My attempts to make our applet that is using RMI use SSL as well have absolutely done my head in.</p>
<p class="MsoNormal">First there was the fact that a self signed certificate wouldnÃ¢â‚¬â„¢t do. This wasnÃ¢â‚¬â„¢t a big surprise, but it wouldnÃ¢â‚¬â„¢t even allow me to test my app to ensure it was working before I forked out the big bucks for the proper SSL certificate.</p>
<p class="MsoNormal">I had an idea, I have a code signing certificate from Thawte that is worth a pretty penny, surely it will at least allow me to test my app, if not be my solution. Strike 2. A Code-Signing certificate can only be used to sign code (JARs in my case), not for authentication Ã¢â‚¬â€œ again, no real surprise.</p>
<p class="MsoNormal">So an SSL certificate was purchased from a company we have a good relationship with, so we got it for wholesale price and away we went&#8230; almost. JavaÃ¢â‚¬â„¢s Virtual Machine looks in a certain spot for trusted certificates, but unlike the major browsers, only has about 15 in there. Of course the certificate we bought was not one of them. Strike 3 &#8211; back to the drawing board. For anyone reading this because they are experiencing similar problems, use:</p>
<p class="MsoNormal">keystore Ã¢â‚¬â€œlist Ã¢â‚¬â€œv Ã¢â‚¬â€œkeystore %JAVA_HOME%/lib/security/cacerts</p>
<p class="MsoNormal">Password: changeit</p>
<p class="MsoNormal">to view the certificates that are in that cacerts file. This is the default file java will look in if you do not specify a trustStore property when calling your applet/application.</p>
<p class="MsoNormal">We found a certificate in here, were able to obtain a refund on the previous and now it was time to invoke methods remotely over secured sockets and love life&#8230; nearly.</p>
<p class="MsoNormal">The first test of this saw love. The problem was that test didnÃ¢â‚¬â„¢t bring browsers into play. I ran the RMI Registry and the Server Implementation, downloaded the jar and ran it from the command line on my PC. Voila!</p>
<p class="MsoNormal">Hello World!</p>
<p class="MsoNormal">I was ecstatic. Until I ran the applet from the same jar and got an error telling me Ã¢â‚¬Å“bad certificateÃ¢â‚¬?. This didnÃ¢â‚¬â„¢t make sense as the root CA of the certificate we were using was certainly in the browser (both Firefox and IE7). A bit of looking around the forums provided very few answers so I decided to post myself (I very rarely post on java forums as the answers to my questions are there if I look hard enough).</p>
<p class="MsoNormal">It turns out that the Root CA certificates in the browsers have a property that specifies what actions a certificate using that Root CA can perform. The certificate we were using was marked for Code Signing, Server Authentication, Email Authentication. Notice Client Authentication missing. *sigh*.</p>
<p class="MsoNormal">This was getting thoroughly annoying as I have now spent 3 weeks trying to test code that only took me a couple of days to fully merge with the older code.</p>
<p class="MsoNormal">I tried checking the Client Authentication box in the browser for out certificate provider, but this didnÃ¢â‚¬â„¢t fool the browser for a second, and I was still denied. After a long chat with an RMI expert, it was concluded that it is not currently possible to enable client authentication in RMI using SSL in an applet. If the application is not running from a browser however, this works as it should. The reason is that when you use the browser, it looks for the certificate there rather than in the parameters specified by the applet.</p>
<p class="MsoNormal">The work around is buy one of the (I think) 2 certificates that support client authentication, though this is untested as we added security other ways and as such, didnÃ¢â‚¬â„¢t purchase one of these certificates.</p>
<p class="MsoNormal">The applet is now running with SSL enabled using Remote Method Invocation. Hurrah!</p>
]]></content:encoded>
			<wfw:commentRss>http://oldmatebrendo.com/2008/03/java-rmi-client-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
