Re: JDBC with SSL

From: Florent Guillaume <fg(at)nuxeo(dot)com>
To: Walter Hurry <walterhurry(at)lavabit(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC with SSL
Date: 2011-12-04 19:09:09
Message-ID: CAF-4BpMJrya0ioXz4vn61bp2BG0X8YR6VkJ00do02n=gM=G2FA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

You have to install the certificate in the Java keystore using "keytool".
See http://docs.oracle.com/javase/tutorial/security/toolsign/rstep2.html
for a quick overview.
A more detailed doc is at
http://docs.oracle.com/javaee/1.4/tutorial/doc/Security6.html

Florent

On Sun, Dec 4, 2011 at 5:40 PM, Walter Hurry <walterhurry(at)lavabit(dot)com> wrote:
> First of all, I am sorry if this is the wrong place to ask. If it is,
> perhaps someone could direct me to the right arena.
>
> This is PostgreSQL 9.0.1 with PostgreSQL JDBC 9.1.901.
>
> I have successfully set up one of my databases to require SSL connections
> with a certificate, and installed a certificate into $HOME/.postgresql.
> That directory contains postgresql.crt,  postgresql.key and root.crt.
>
> I can connect successfully using psql and libpq applications. The
> connection is also rejected properly if I move the certificate out of the
> way.
>
> Now I am trying to connect using JDBC and SSL from a Java application
> (JDBC is fine without SSL on another database). However, I am getting the
> following error:
>
> FATAL: connection requires a valid client certificate
>
> So it appears that somehow I need to "tell" Java where to find the client
> certificate. Any pointers as to how I do this please?
>
> By the way, since this is a self-signed certificate I have followed the
> instructions at <http://jdbc.postgresql.org/documentation/81/ssl-
> client.html>. These succeeded, but I am still getting the error.
>
> Thanks,
> Walter
>
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

--
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Walter Hurry 2011-12-04 20:48:06 Re: JDBC with SSL
Previous Message Walter Hurry 2011-12-04 16:40:47 JDBC with SSL