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
{{ message }}
Repository navigation
Cannot connect via encrypted connection to SQL Server 2008 SP2 #610
My app is trying to connect to SQL Server 2008 SP2. The connections are configured to be encrypted. The connection always times out at the configured connectionTimeout. I've talked to the DBA, and he's seeing the following error:
"The prelogin packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: ...]"
SQL Server doesn't respond after successful handshake 😞 One odd thing I noticed while looking at this issue is during Login7, a single packet shows 2 TLS exchange in wireshark, for SQL Server 2008. This would need more investigation.
@v-suhame the server not responding after the handshake seemed to be happening to me too. I also saw 2 TLS exchanges in wireshark. This makes me think that's what is causing the "structurally invalid" error, since it's only supposed to be sending a single Login7 packet.
How did you gather this from looking at debug_output.txt referenced above?
@ferm10n I couldn't gather much from the debug_output.txt. I had an instance of SQL Server 2008 in internal test lab, I was able to repro it there 😉, and +1 for informing about Microsoft Message Analyzer, that will come handy.
After some digging, I found that cipher suite negotiated during handshake is not supported in SQL Server 2008, possibly for versions < SQL Server 2008 SP4, as they only support TLSv1.0, details here.
Specifying proper cipher suite in config does the trick, e.g.
@v-suhame Thank you very much! That did the trick.
It's interesting that it negotiates to use a cipher suite that isn't supported. Any idea why that happens?
Activity
slmmm commentedon Aug 31, 2017
Have you set your connection options for encrypted before attempting to connect?
options: {
encrypt: true
}
eplowe commentedon Aug 31, 2017
eplowe commentedon Aug 31, 2017
I made a switch over to mssqlnodev8, it connects fine. But, this locks me to using windows boxes only.
Suraiya-Hameed commentedon Aug 31, 2017
@eplowe try enabling the debug log in driver to get more details. If you need assistance, you can share the logs either in github or via email.
eplowe commentedon Aug 31, 2017
Sure thing. See attached.
debug_output.txt
ferm10n commentedon Oct 16, 2017
I'm also experiencing this exact issue. Any assistance for this would be greatly appreciated.
Suraiya-Hameed commentedon Oct 26, 2017
SQL Server doesn't respond after successful handshake 😞 One odd thing I noticed while looking at this issue is during Login7, a single packet shows 2 TLS exchange in wireshark, for SQL Server 2008. This would need more investigation.
ferm10n commentedon Oct 26, 2017
@v-suhame the server not responding after the handshake seemed to be happening to me too. I also saw 2 TLS exchanges in wireshark. This makes me think that's what is causing the "structurally invalid" error, since it's only supposed to be sending a single Login7 packet.
How did you gather this from looking at debug_output.txt referenced above?
I found Microsoft Message Analyzer to be more helpful than wireshark with better parsing of TDS messages. https://technet.microsoft.com/en-us/library/dn727244.aspx
Suraiya-Hameed commentedon Oct 26, 2017
@ferm10n I couldn't gather much from the debug_output.txt. I had an instance of SQL Server 2008 in internal test lab, I was able to repro it there 😉, and +1 for informing about Microsoft Message Analyzer, that will come handy.
After some digging, I found that cipher suite negotiated during handshake is not supported in SQL Server 2008, possibly for versions < SQL Server 2008 SP4, as they only support TLSv1.0, details here.
Specifying proper cipher suite in config does the trick, e.g.
List of supported specs:
https://msdn.microsoft.com/en-us/library/aa380512.aspx
https://msdn.microsoft.com/en-us/library/aa380124.aspx
--Updates--
Cipher name to use in
configfor the specs in the link above is in https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-SUITE-NAMESSuraiya-Hameed commentedon Oct 26, 2017
@eplowe @ferm10n can you test the solution suggested?
ferm10n commentedon Oct 31, 2017
@v-suhame Thank you very much! That did the trick.
It's interesting that it negotiates to use a cipher suite that isn't supported. Any idea why that happens?
Suraiya-Hameed commentedon Oct 31, 2017
Yes, it is weird! I couldn't dig much as it was taken care by the
tlspackage and SQL Server, nothing to do with Tedious directly.Suraiya-Hameed commentedon Oct 31, 2017
Thanks for testing @ferm10n the solution, I'll close this issue :)
eplowe commentedon Oct 31, 2017