TLS Handshake Error: Azure SQL Database Upgrade to v12 Impacts Connections
An Azure SQL Database upgrade to version 12 (v12) has caused connectivity issues for some applications, resulting in this error:
TLS Handshake failed: x509: certificate is valid for
tr12.northcentralus1-a.worker.database.windows.net,
*.tr12.northcentralus1-a.worker.database.windows.net, not [server-name].database.windows.net
Cause
The error occurs because the certificate presented by the Azure SQL Database is not valid for the server name specified in the connection string. This is due to a change in the way v12 handles certificate validation.
Resolution
To resolve the issue, modify the connection string to include the following parameters:
TrustServerCertificate=True; hostNameInCertificate=*.database.windows.net;
Additional Notes
The above is the detailed content of Here are a few title options that fit the question-answer format you requested: Option 1 (Focus on the problem): * Azure SQL Database v12 Upgrade: Why am I getting TLS Handshake Errors? Option 2 (F. For more information, please follow other related articles on the PHP Chinese website!