Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DC639634346 for ; Mon, 23 Feb 2009 07:25:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01770-03 for ; Mon, 23 Feb 2009 07:25:47 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) by mail.postgresql.org (Postfix) with ESMTP id 896D063396A for ; Mon, 23 Feb 2009 07:25:43 -0400 (AST) Received: from localhost (mail2.mnc.ch [127.0.0.1]) by mail.mnc.ch (Postfix) with ESMTP id 0CF742307A; Mon, 23 Feb 2009 11:25:40 +0000 (GMT) X-Virus-Scanned: amavisd-new at mnc.ch Received: from mail.mnc.ch ([127.0.0.1]) by localhost (mail2.mnc.ch [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id PNshwPisZv8V; Mon, 23 Feb 2009 11:25:39 +0000 (GMT) Received: from meuh.localdomain (62-2-77-204.static.cablecom.ch [62.2.77.204]) by mail.mnc.ch (Postfix) with ESMTP id 8132023079; Mon, 23 Feb 2009 11:25:39 +0000 (GMT) Received: by meuh.localdomain (Postfix, from userid 1000) id 44CB6DF211; Mon, 23 Feb 2009 12:25:40 +0100 (CET) To: Kris Jurka Cc: Saleem EDAH-TALLY , pgsql-jdbc@postgresql.org Subject: Re: SSL - Providing client certificates References: <200902201030.33352.nmset@netcourrier.com> From: Guillaume Cottenceau X-Hashcash: 1:20:090223:books@ejurka.com::xcPslE9WU4tV2LnZ:04F/o X-Hashcash: 1:20:090223:nmset@netcourrier.com::2hkB2XivKqx7uAPj:00000000000000000000000000000000000000006EKG X-Hashcash: 1:20:090223:pgsql-jdbc@postgresql.org::WIkj8ulsVBR0BMwC:0000000000000000000000000000000000003zIX Date: Mon, 23 Feb 2009 12:25:40 +0100 In-Reply-To: (Kris Jurka's message of "Fri\, 20 Feb 2009 12\:29\:39 -0500 \(EST\)") Message-ID: <87iqn1v1hn.fsf@meuh.mnc.lan> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/40 X-Sequence-Number: 19315 Kris Jurka writes: > On Fri, 20 Feb 2009, Saleem EDAH-TALLY wrote: > >> However, if we set javax.net.ssl.keyStore and javax.net.ssl.keyStorePassword, >> the SSL connection is established and the client certificate is verified. >> > > When the code was first written, this wasn't tested and it was just > assumed that it wouldn't work. Recently we got a report that it did > work, but the documentation was not updated. > > What I don't understand is how it selects the certificate to send. If > you have multiple keys in your keystore, how do you indicate which one > to use? My quite limited understanding of the behaviour of SSL client authentication may potentially help a little: You initially send a certificate signing request to the admin/owner of the server (signed with your private key); when you receive the certificate reply (signed with their private key), you can build a chain of trust between you and the server, your keystore will look like: Entry type: PrivateKeyEntry Certificate chain length: 2 Certificate[1]: Owner: Issuer: Certificate[2]: Owner: Issuer: Then at the SSL handshake time, first the server presents his certificate, second it asks for a client certificate, at that time you are able to present the certificate belonging to the chain of trust containing the server certificate on top. -- Guillaume Cottenceau