1
votes

I am trying to connect to a CloudSQL instance using the certificates provided by google namely "client-cert.pem", "client-key.pem" and "server-ca.pem".

Can someone suggest what to keep in keystore and what in truststore for SSL connection using jdbc.

The client I am using is teiid.

P.S. - I tried importing client-cert.pem into keystore by converting it into p12 file, also imported it in cacerts of jdk, but nothing is working in my case. For truststore I imported server-ca.pem into a seperate keystore.

2

2 Answers

0
votes

If your only goal is to connect via SSL, I suggest you take a look at the Cloud SQL JDBC SocketFactory. This SocketFactory provides SSL connections to a Cloud SQL instance, authenticated with IAM credentials.

If you want to manually specify certificates you've created directly to the JDBC driver, you can follow these instructions here to configure the system properties to do so. .