Operating system: Docker container for the app, Windows for the SQL Server I would expect the connection to be established since the root CA's certificate has been added to the trusted root within the container. The issue shows up as soon as we try to make a connection to the SQL Server from the container, so it should be fairly simple to reproduce.
Only after explicitly setting Encrypt=False in the connection string the error goes away. Even after disabling encryption on the server we still receive the same error. End of stack trace from previous location -Īt (HealthCheckContext context, CancellationToken cancellationToken)ĬlientConnectionId:32fb614f-d95f-4cb9-9c4b-d54ce172d57dĮrror Number:-2146893019,State:0,Class:20 > : The remote certificate was rejected by the provided RemoteCertificateValidationCallback.Īt .SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)Īt .CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)Īt .ForceAuthenticationAsync(TIOAdapter adapter, Boolean receiveFirst, Byte reAuthenticationData, Boolean isApm)Īt .AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)Īt .AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)Īt .SNITCPHandle.EnableSsl(UInt32 options)Īt .TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)Īt .TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)Īt .TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)Īt .TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)Īt .TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)Īt .TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)Īt .InternalOpenAsync(CancellationToken cancellationToken) (provider: TCP Provider, error: 35 - An internal exception was caught)
(0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake.