Skip to content
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

Suppress roslyn errors and warnings #2936

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,12 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
uint returnValue = SNINativeMethodWrapper.SNIWaitForSSLHandshakeToComplete(Handle, GetTimeoutRemaining(), out uint nativeProtocolVersion);
var nativeProtocol = (NativeProtocols)nativeProtocolVersion;
#pragma warning disable CA5398 // Avoid hardcoded SslProtocols values
if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_2_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_2_SERVER))
{
protocolVersion = (int)SslProtocols.Tls12;
}
#if NET6_0_OR_GREATER
#if NET6_0_OR_GREATER
else if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_3_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_TLS1_3_SERVER))
{
/* The SslProtocols.Tls13 is supported by netcoreapp3.1 and later */
Expand Down Expand Up @@ -439,6 +440,7 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
{
protocolVersion = (int)SslProtocols.None;
}
#pragma warning restore CA5398 // Avoid hardcoded SslProtocols values
return returnValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ private static string ToFriendlyName(this SslProtocols protocol)
{
name = "TLS 1.3";
}*/
#pragma warning disable CA5398 // Avoid hardcoded SslProtocols values
if ((protocol & SslProtocols.Tls12) == SslProtocols.Tls12)
{
name = "TLS 1.2";
Expand Down Expand Up @@ -795,6 +796,7 @@ private static string ToFriendlyName(this SslProtocols protocol)
{
name = "SSL 2.0";
}
#pragma warning restore CA5398 // Avoid hardcoded SslProtocols values
else
{
#if !NETFRAMEWORK
Expand All @@ -818,9 +820,11 @@ public static string GetProtocolWarning(this SslProtocols protocol)
#if NET8_0_OR_GREATER
#pragma warning disable SYSLIB0039 // Type or member is obsolete: TLS 1.0 & 1.1 are deprecated
#endif
#pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
#pragma warning disable CS0618 // Type or member is obsolete : SSL is deprecated
#pragma warning disable CA5398 // Do not use deprecated SslProtocols values
if ((protocol & (SslProtocols.Ssl2 | SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11)) != SslProtocols.None)
#pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
#pragma warning restore CA5398 // Do not use deprecated SslProtocols values
#pragma warning restore CS0618 // Type or member is obsolete : SSL is deprecated
#if NET8_0_OR_GREATER
#pragma warning restore SYSLIB0039 // Type or member is obsolete: SSL and TLS 1.0 & 1.1 is deprecated
#endif
Expand Down
Loading