-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TDS8 - Enable retrieval of TLS 1.3 SSL Protocol from SNI on .NET Core #1821
TDS8 - Enable retrieval of TLS 1.3 SSL Protocol from SNI on .NET Core #1821
Conversation
Codecov ReportBase: 71.38% // Head: 71.34% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1821 +/- ##
==========================================
- Coverage 71.38% 71.34% -0.04%
==========================================
Files 290 290
Lines 61236 61251 +15
==========================================
- Hits 43712 43702 -10
- Misses 17524 17549 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
* This driver does not support this version yet! */ | ||
#if NETCOREAPP3_1_OR_GREATER | ||
if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_3_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_3_SERVER)) | ||
{ | ||
protocolVersion = (int)SslProtocols.Tls13; | ||
}*/ | ||
} | ||
else if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_2_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_2_SERVER)) | ||
#else | ||
if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_2_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_2_SERVER)) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not required to be the first statement in the chain of if-else
statements. This additional condition can be added as a else if
just for simplification.
Also, the related inline comments won't be valid anymore.
@@ -425,12 +425,16 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion) | |||
var nativeProtocol = (NativeProtocols)nativeProtocolVersion; | |||
|
|||
/* The SslProtocols.Tls13 is supported by netcoreapp3.1 and later | |||
* This driver does not support this version yet! | |||
* This driver does not support this version yet! */ | |||
#if NETCOREAPP3_1_OR_GREATER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not supporting netcoreapp3.1 it should suffice if we just want to check for NETCOREAPP and omit the version.
#if NETCOREAPP3_1_OR_GREATER | |
#if NETCOREAPP |
I ran into a timeout issue during
WaitForSSLHandShakeToComplete
when I ran .NET Core with TLS 1.3 and noticed a commented-out section where it checks for TLS 1.3 and returningSslProtocols.None
. However, I ran into a compile error when uncommenting a check for the ssl protocol while testing .NET Core with TLS1.3 when building the MDS project on .NET standard 2.1 becauseSslProtocols.Tls13
does not exist. TheSslProtocols.Tls13
does exist on .NET Core 3.1 and above, so I added anif-def
for it, so that I can get past the timeout issue where the retrieval of the protocol version occurs.