Now that Resteasy 3.0-beta-1 is out, I’ve been thinking a lot about some custom security protocols I’d like to prototype.  Client cert authentication has always been a part of that thinking, but when it comes to browsers, client certificates are complex and even scary for most users.  Why does it have to be this way?

Current web authentication uses cookies to set up a secure session between an authenticated user and his browser.  Cookies are allocated and stored per-domain and forwared with HTTP requests to those domains.  Why can’t we do something similar with SSL and client certificates?

For example, what if when you registered at Google.com, it asked you, “Do you want to authorize this device?”.  You would click on a “OK” button and Google would generate a key-pair and a digitially google-signed certificate for your device.  The HTTP response to clicking that “OK” button would provide a base 64 encoded headers that contained the generated private key and signed certificate:

HTTP/1.1 200 OK
Content-Type: text/html
Set-Private-Key: 23423ab1123affaccde12312
Set-Certificate: 11ab332789dff


<h1>All Set</h1>
<p>Your machine is now authorized</p>

For the google.com domain, your browser would store the private key and certificate in your browser’s persistent store.  The next time your browser makes an HTTPS connection to google.com, it would use this certificate to connect.  When you think about it, this isn’t much different than google setting a persistent cookie to remember who you are.  Now its remembering you in a much more secure way.

Additionally, what would be cool, if this google-generated client-cert could be negotiated and sent to other domains/websites on the internet.  For example, let’s say you had a social media site that exchanged sensitive information and wanted to use HTTPS.  The social media site could send a redirect, with an additional certificate negotiation header stating which client-cert domains it prefers

HTTP/1.1 307
Location: https:/.../
Accept-Certificate: google.com, facebook.com

Here, the server is redirecting us to an HTTPS based URL.  The Accept-Certificate says that it requires a google.com or facebook.com generated client certificate.  The browser would then make an SSL connection to the redirect URL using a stored client cert from one of the preferred domains.

There’s a bunch of cool things about this.  For one, you could have SSO to multiple different social media sites and applications without the need to enter one password.  Secondly, there’s a lot of secure protocols you could implement on top of this to make the internet as a whole, more secure.  Most importantly, there’s no knowledge the human user has to have as to install a client certificate.  It really sucks that the microsofts, mozillas, apples, and googles of the world haven’t put much more thought into client-certs and making them easier to use.