pgjdbc is not working with PKCS8 certificates with password - Mailing list pgsql-bugs

From just madhu
Subject pgjdbc is not working with PKCS8 certificates with password
Date
Msg-id CALwjh=QQUdwfNq6dakWC-DOSSN2jABYsKXgAzL4gzFd0K1mqmQ@mail.gmail.com
Whole thread Raw
Responses Re: pgjdbc is not working with PKCS8 certificates with password  (just madhu <justvmadhu@gmail.com>)
Re: pgjdbc is not working with PKCS8 certificates with password  (just madhu <justvmadhu@gmail.com>)
List pgsql-bugs
Hi ,

postgresql-42.7.1.jar

Trying to use establish a connection using PKCS8 certificate created with password.

openssl pkcs8 -topk8 -inform PEM -in client.key -outform DER -out client.pk8  -passout pass:foobar

I set the properties as below:
...
sslProperties.setProperty("sslkey", "client.pk8");
sslProperties.setProperty("sslpassword","foobar");
...
Connection connection = DriverManager.getConnection(jdbcUrl, sslProperties);
....
This is failing with the error:
org.postgresql.util.PSQLException: SSL error: Connection reset
at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:43)
at org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:584)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168)
...

Regards,
Madhu

pgsql-bugs by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: v17 Possible Union All Bug
Next
From: just madhu
Date:
Subject: Re: pgjdbc is not working with PKCS8 certificates with password