A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0)
Bump into this error today. Strange enough the application is able to use the same connection string to connect successfully, then failed the next. The database is configure with highly available group.
I have TrustCertificate=true;Encrypt=true;MultisubnetFailvover=true
Yet it still breaks.
From the message itself, it is clear we not having a credential issue as we are able to connect successfully. It just can't make the connection sticks.
Then later i found out that - we need to connect to another different dns and port number. After checking with the dba.
So this error can be tricky, as many people suggest turning TrustCertificate=false, Encrypt=false. I guess a better way to test is basically use a sample app that opens up a connection to the database server from the box itself.
Comments