postgresql-jdbc.git / summary / log / commit / refs

commit    e05f92b8586d4e14140fbbb3d7ce3a5b8b3d2d11
Author:   Dave Cramer <davec@fastcrypt.com>
Date:     Mon Nov 28 11:24:19 2011 +0000

    removed Override to compile with java 1.4 added extra docs for ssl from Mikko Tiihonen


certdir/README | 13 +++++++++++++ org/postgresql/ssl/LazyKeyManager.java | 6 ------ org/postgresql/ssl/LibPQFactory.java | 2 -- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/certdir/README b/certdir/README index a555f572..6139bf9b 100644 --- a/certdir/README +++ b/certdir/README @@ -40,5 +40,18 @@ cp server.crt ../goodroot.crt #Common name is localhost, no password The subdirectory server contains what should be copied to the PGDATA directory. +If you do not overwrite the pg_hba.conf then remember to comment out all lines +starting with "host all". For the tests the sslinfo module must be installed into every database. +The ssl=on must be set in postgresql.conf + +The following command creates the databases and installs the sslinfo module. + +for db in hostssldb hostnossldb certdb hostsslcertdb; do + createdb $db + psql $db -c "create extension sslinfo" +done + +The username for connecting to postgres as specified in build.local.properties tests has to be "test". + diff --git a/org/postgresql/ssl/LazyKeyManager.java b/org/postgresql/ssl/LazyKeyManager.java index 1f1abf67..a1735d22 100644 --- a/org/postgresql/ssl/LazyKeyManager.java +++ b/org/postgresql/ssl/LazyKeyManager.java @@ -75,7 +75,6 @@ public class LazyKeyManager implements X509KeyManager { if (error!=null) throw error; } - @Override public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) { if (certfile==null) @@ -105,13 +104,11 @@ public class LazyKeyManager implements X509KeyManager { } } - @Override public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { return null; //We are not a server } - @Override public X509Certificate[] getCertificateChain(String alias) { if (cert==null && certfile!=null) //If certfile is null, we do not load the certificate { //The certificate must be loaded @@ -145,13 +142,11 @@ public class LazyKeyManager implements X509KeyManager { return cert; } - @Override public String[] getClientAliases(String keyType, Principal[] issuers) { String alias = chooseClientAlias(new String[]{keyType}, issuers, (Socket)null); return (alias==null ? new String[]{} : new String[]{alias}); } - @Override public PrivateKey getPrivateKey(String alias) { try { @@ -244,7 +239,6 @@ public class LazyKeyManager implements X509KeyManager { return key; } - @Override public String[] getServerAliases(String keyType, Principal[] issuers) { return new String[]{}; } diff --git a/org/postgresql/ssl/LibPQFactory.java b/org/postgresql/ssl/LibPQFactory.java index 06489059..565088d5 100644 --- a/org/postgresql/ssl/LibPQFactory.java +++ b/org/postgresql/ssl/LibPQFactory.java @@ -216,7 +216,6 @@ public class LibPQFactory extends WrappedFactory implements HostnameVerifier { * @throws UnsupportedCallbackException If the console is not available * or other than PasswordCallback is supplied */ - @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { Console cons = System.console(); @@ -251,7 +250,6 @@ public class LibPQFactory extends WrappedFactory implements HostnameVerifier { * @param session The SSL session. * @returns true if the certificate belongs to the server, false otherwise. */ - @Override public boolean verify(String hostname, SSLSession session) { X509Certificate[] peerCerts; try [parent: 59fcdac5d064]