Skip to content

Commit

Permalink
removed Override to compile with java 1.4 added extra docs for ssl fr…
Browse files Browse the repository at this point in the history
…om Mikko Tiihonen
  • Loading branch information
Dave Cramer committed Nov 28, 2011
1 parent 59fcdac commit e05f92b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 13 additions & 0 deletions certdir/README
Original file line number Diff line number Diff line change
Expand Up @@ -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".

6 changes: 0 additions & 6 deletions org/postgresql/ssl/LazyKeyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public void throwKeyManagerException() throws PSQLException
if (error!=null) throw error;
}

@Override
public String chooseClientAlias(String[] keyType, Principal[] issuers,
Socket socket) {
if (certfile==null)
Expand Down Expand Up @@ -105,13 +104,11 @@ public String chooseClientAlias(String[] keyType, Principal[] issuers,
}
}

@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
Expand Down Expand Up @@ -145,13 +142,11 @@ public X509Certificate[] getCertificateChain(String alias) {
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
{
Expand Down Expand Up @@ -244,7 +239,6 @@ public PrivateKey getPrivateKey(String alias) {
return key;
}

@Override
public String[] getServerAliases(String keyType, Principal[] issuers) {
return new String[]{};
}
Expand Down
2 changes: 0 additions & 2 deletions org/postgresql/ssl/LibPQFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ public ConsoleCallbackHandler(String password)
* @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();
Expand Down Expand Up @@ -251,7 +250,6 @@ public void handle(Callback[] callbacks) throws IOException,
* @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
Expand Down

0 comments on commit e05f92b

Please sign in to comment.