You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Sql Server that we connect to from an azure hosted docker container (Alpine .net 7, SqlClient 5.1.0).
We've previously used TrustServerCertificate=true to bypass the fact we connect via an IP (of a firewall or gateway or something) from azure which obviously name mismatches the cert issued by an internal CA.
With the addition of HostNameInCertificate we're now trying to remove the TrustServerCertificate from the connection string, but receive the following error:
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
While this is clearly a cert validation issue, we get no information about why the certificate failed, and an afternoon of searching has given me no leads (A simple server name typo in the conn string? Incorrectly installed root cert in the docker container? Unable to access CRL url? Who knows?), hence this question.
Can anyone provide guidance on diagnosing cert validation errors from SqlClient, particularly when occurring inside a linux docker image on Azure App Service?
The text was updated successfully, but these errors were encountered:
We have a Sql Server that we connect to from an azure hosted docker container (Alpine .net 7, SqlClient 5.1.0).
We've previously used
TrustServerCertificate=true
to bypass the fact we connect via an IP (of a firewall or gateway or something) from azure which obviously name mismatches the cert issued by an internal CA.With the addition of
HostNameInCertificate
we're now trying to remove theTrustServerCertificate
from the connection string, but receive the following error:While this is clearly a cert validation issue, we get no information about why the certificate failed, and an afternoon of searching has given me no leads (A simple server name typo in the conn string? Incorrectly installed root cert in the docker container? Unable to access CRL url? Who knows?), hence this question.
Can anyone provide guidance on diagnosing cert validation errors from SqlClient, particularly when occurring inside a linux docker image on Azure App Service?
The text was updated successfully, but these errors were encountered: