TLS Handshake Error in Azure SQL Database After v12 Upgrade
Since upgrading to v12, users accessing Azure SQL Database from Azure Web Apps may encounter a "TLS Handshake failed" error. This error stems from a certificate mismatch between the web app's connection string and the database server.
The issue arises from the updated TLS configuration in v12, which requires a connection string that explicitly trusts the server certificate and specifies the hostname included in the certificate.
Solution
To resolve this error, modify the connection string in your web app to include the following parameters:
Example Connection String
Here is a modified connection string that should resolve the error:
Server=[server-name].database.windows.net;Port=1433;Database=[dbname];User ID=[user];Password=[pass];Trusted_Connection=False;Encrypt=True;Connection Timeout=30;TrustServerCertificate=True;hostNameInCertificate=*.database.windows.net
Note: The Azure portal suggests using the TrustServerCertificate=False setting. However, this may not be compatible with the updated TLS configuration in v12.
The above is the detailed content of Here are a few options for a question-style title based on your article: Focused on the Issue: * Azure SQL Database v12 Upgrade: Why Am I Getting a \'TLS Handshake Failed\' Error? * TLS Ha. For more information, please follow other related articles on the PHP Chinese website!