0
votes

I created a Cloud SQL instance and am trying to connect from my laptop running OSX El Capitan.

I followed the instructions for creating a proxy to run the proxy. I am able to connect if I use a socket file as follows:

sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:mysql-instance -credential_file=mycredentials.json

mysql -u root -p -S /cloudsql/my-project:us-central1:mysql-instance

Now I'd like to connect to the Cloud SQL instance from a local python application. So I tried creating the proxy over tcp using =tcp:3306 and testing using the mysql client as follows:

sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:mysql-instance=tcp:3306 -credential_file=/web/visi/api/resources/keys/visi-staging-ec040759d57a.json

mysql -u root --host 127.0.0.1 --password

But Im getting this error:

2016/04/06 23:09:58 Got a connection for "my-project:us-central1:mysql-instance" 2016/04/06 23:09:59 to "my-project:us-central1:mysql-instance" via 111.111.111.111:3307: read tcp 127.0.0.1:3306->127.0.0.1:49518: use of closed network connection ERROR 2026 (HY000): SSL connection error: error:00000005:lib(0):func(0):DH lib

1

1 Answers

0
votes

Try specifying --skip-ssl as an option to your mysql client.

We have a fix for this in progress and should be rolled out in the near future.

The reason this happens is that we reject connections over the proxy that request MySQL SSL. The connection between the proxy and Cloud SQL is already done over SSL so there's no need to use SSL at the MySQL level.