Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 50BF39ED57F for ; Wed, 7 Dec 2011 01:06:33 -0400 (AST) Received: from mail-gy0-f174.google.com ([209.85.160.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RY9iB-00036V-IK for pgsql-jdbc@postgresql.org; Wed, 07 Dec 2011 05:06:32 +0000 Received: by ghbz2 with SMTP id z2so156380ghb.19 for ; Tue, 06 Dec 2011 21:06:18 -0800 (PST) Received: by 10.236.175.72 with SMTP id y48mr24826417yhl.17.1323234378239; Tue, 06 Dec 2011 21:06:18 -0800 (PST) Received: from [10.0.0.53] (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id l19sm1748151anc.14.2011.12.06.21.06.15 (version=SSLv3 cipher=OTHER); Tue, 06 Dec 2011 21:06:17 -0800 (PST) Message-ID: <4EDEF445.10006@ringerc.id.au> Date: Wed, 07 Dec 2011 13:06:13 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Walter Hurry CC: pgsql-jdbc@postgresql.org Subject: Re: JDBC with SSL References: <4EDC1031.2010607@ringerc.id.au> <4EDD65BC.4010605@ringerc.id.au> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/34 X-Sequence-Number: 22488 On 07/12/11 03:43, Walter Hurry wrote: > On Tue, 06 Dec 2011 08:45:48 +0800, Craig Ringer wrote: > >> On 12/06/2011 02:46 AM, Walter Hurry wrote: >>> ------------------------------------------------------------- $ java >>> -Djavax.net.ssl.keyStore=$HOME/.postgresql/clientstore \ >>> -Djavax.net.ssl.keyStorePassword=changeit \ >>> -Djavax.net.ssl.keyStoreType="jks" \ >>> >> I thought you could only use a JECKS store when including private keys? > Sorry, I'm pretty new to all this. What is a JECKS store? Does it mean I > have the keyStoreType wrong? JKS and JECKS are two different key store formats. Keytool understands both. If my memory serves, JECKS is the encrypted keystore format, intended for storing private key data. I think you can use JECKS for both certificate and key data, but you can use JKS only for certificate data, NOT for key data. If you want your trusted certs and your client certs+keys in the same store, use a JECKS store by passing the "-storetype JECKS" argument to keytool when creating the store and importing a cert into it. I have the niggling memory that if you use the JKS store (default) then keytool imports the certificate from your input pkcs#2 (or whatever) file and ignores the key. -- Craig Ringer