Google Cloud SQL with SSL ΒΆ

To connect to Google Could SQL, you currently need to disable certificate verification. This is caused by the certficate being issued for CN matching your instance name, but you connect to an IP address and PHP tries to match these two. With verfication you end up with error message like:

Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8' 

Warning

With disabled verification your traffic is encrypted, but you're open to man in the middle attacks.

To connect phpMyAdmin to Google Cloud SQL using SSL download the client and server certificates and tell phpMyAdmin to use them:

// IP address of your instance $cfg['Servers'][$i]['host'] = '8.8.8.8'; // Use SSL for connection $cfg['Servers'][$i]['ssl'] = true; // Client secret key $cfg['Servers'][$i]['ssl_key'] = '../client-key.pem'; // Client certificate $cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem'; // Server certification authority $cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem'; // Disable SSL verification (see above note) $cfg['Servers'][$i]['ssl_verify'] = false; 

See also

Using SSL for connection to database server, $cfg['Servers'][$i]['ssl'], $cfg['Servers'][$i]['ssl_key'], $cfg['Servers'][$i]['ssl_cert'], $cfg['Servers'][$i]['ssl_ca'], $cfg['Servers'][$i]['ssl_verify'], <https://bugs.php.net/bug.php?id=72048>