Question

SSL to Google Cloud SQL

  • 7 October 2022
  • 3 replies
  • 161 views

We are trying to connect to Google Cloud SQL and it generates three certificates.
client-cert.pem, client-key.pem and server-ca.pem
Please refer: https://cloud.google.com/sql/docs/postgres/configure-ssl-instance

And an example usin the native psql:
https://cloud.google.com/sql/docs/postgres/connect-admin-ip#connect-ssl

Using SDC, connect String:
jdbc:postgresql://x.x.x.x/postgres?sslmode=require&sslcert=/etc/sdc/client-cert.pem&sslkey=/etc/sdc/client-key.pem

The below error is coming:
JDBC_00 - Cannot connect to specified database: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Loading the SSL certificate /etc/sdc/client-cert.pem into a KeyManager failed.
: hikariConfigBean.connectionString

 

Pleae help.

 


3 replies

Userlevel 4
Badge

@anirbanch 

have you tried using 

jdbc:postgresql://x.x.x.x/postgres?sslmode=require&sslcert=client-cert.pem&sslkey=client-key.pem

 

Hi @saleempothiwala , we got a solution now from Support. .pem is not supported as a client key and after its changed to pkcs8 format, it worked. 

Userlevel 4
Badge

@anirbanch  all is well that ends well :-)

 

Reply