PHP MySQL over SSL. Peer certificate did not match

前端 未结 5 1991
死守一世寂寞
死守一世寂寞 2020-12-25 13:56

I\'m trying to use Google Cloud SQL over SSL from GCE(Google Compute Engine) instance. My problem is that I cannot connect to Cloud SQL instance over SSL.

mysql comm

5条回答
  •  隐瞒了意图╮
    2020-12-25 14:20

    I had the same problem with a MySQL database hosted at compose cluster.

    After searching and testing for hours, I found out that the best solution is to disable testing the certificate provided by the server by using the MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT flag.

    I haven't tested it with PDO but with the mysqli interface it is working for me. In general this problem would appear with a database hosted at a cluster server.

提交回复
热议问题