-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS using Cloud SQL cannot verify server certificate. #908
Comments
I also tried |
':' is not a vlid character in hostnames apparently. I see in the x509/verify.go code there is allowance for another non-standard character '_' in the follow code snippet from there:
So I guess I'll submit a PR there for Cloud SQL deployments...
|
And that exact change is already in master there. |
The correct way to connect to a Cloud SQL instance using TLS is to follow these steps:
|
Issue description
I'm trying to connect to a Cloud SQL instance using a TLS connection. I've created certificates in the Cloud SQL console and I'm setting them up using code that is similar to what's below. However the server certificate validation does not seem to work. The error is seen when I try to create a prepared statement using
sql.DB.Prepare(...)
. The only way I can use TLS is if I addInsecureSkipVerify: true
to my TLS config, the connection works fine if I do that. I've been able to use the same certificate/key files to connect with JDBC and mysql-client.Example code
Error log
Configuration
Driver version (or git SHA): Version 1.4 (2018-06-03)
Go version: go1.11 darwin/amd64
MySQL version: 5.7.14-google-log
Server OS: Whatever Cloud SQL is currently using.
The text was updated successfully, but these errors were encountered: