From 98acbf108903b7539d70a4068cc9bdd0fa5966fa Mon Sep 17 00:00:00 2001 From: David Engel Date: Wed, 20 Jul 2022 11:13:51 -0700 Subject: [PATCH] Fix inconsistency between netcore and netfx (#1672) --- .../netfx/src/Microsoft/Data/SqlClient/TdsParser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs index 664c6e56d5..af7a8c40d2 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -682,7 +682,7 @@ internal void Connect(ServerInfo serverInfo, if (!ClientOSEncryptionSupport) { //If encryption is required, an error will be thrown. - if (encrypt == SqlConnectionEncryptOption.Mandatory) + if (encrypt != SqlConnectionEncryptOption.Optional) { _physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByClient(), "", 0)); _physicalStateObj.Dispose();