postgresql SSL unable to connect

I am trying to connect an application named thingsboard with a postgresql DB both running on Google Cloud Engine. I have the following files provided by GCE when I set up the DB as allow only SSL connections:

client-cert.pem client-key.pem server-ca.pem

This is where the connection to the DB is set up. I tried with a the client-key.pem as client-key.pem, client-key.key, client-key.pk8 (with and without passphrase, when added passphrase I added the field "sslpassword=MYKEY"

url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://DATABASEIP:5432/thingsboard?sslmode=verify-ca&sslrootcert=/etc/thingsboard/conf/keystore/server-ca.pem&sslcert=/etc/thingsboard/conf/keystore/client-cert.pem&sslkey=/etc/thingsboard/conf/keystore/client-key.pk8}"
username: "${SPRING_DATASOURCE_USERNAME:MYDBUSERNAME}"
password: "${SPRING_DATASOURCE_PASSWORD:MYDBPASSWORD}"

I am getting the following error

2019-01-16 18:55:32,866 [localhost-startStop-1] ERROR o.a.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.
org.postgresql.util.PSQLException: Could not read SSL key file /etc/thingsboard/conf/keystore/client-key.pk8.
8 Related questions 1 Resolving "ssl handshake failure" error in PostgresQL 10 Postgres SSL error 133 Using psql to connect to PostgreSQL in SSL mode Related questions 1 Resolving "ssl handshake failure" error in PostgresQL 10 Postgres SSL error 133 Using psql to connect to PostgreSQL in SSL mode 25 psql: FATAL: connection requires a valid client certificate 13 Error connecting to server : received invalid response to SSL negotiation 2 Enable SSL connections on PostgreSQL server 3 SSL connection error in PostgreSQL 8.0 20 "HostName not verified error message" on SSL connection in postgresql 0 PostgreSQL connection require a valid client certificate 1 Error When Connecting Postgres Db: Server Certificate Does Not Match Host Name Load 7 more related questions Show fewer related questions Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like