Skip to content

Commit

Permalink
Temporarily disable pragma SYSLIB0014 from CSharp CodeFix Verifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossanlop committed Aug 21, 2024
1 parent 1ab8a2b commit 4d3ab63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ static Test()
// reasonable TLS protocol version for outgoing connections.
#pragma warning disable CA5364 // Do Not Use Deprecated Security Protocols
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable SYSLIB0014 // ServicePointManager is obsolete
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
#pragma warning restore SYSLIB0014 // ServicePointManager is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5364 // Do Not Use Deprecated Security Protocols
{
#pragma warning disable CA5386 // Avoid hardcoding SecurityProtocolType value
#pragma warning disable SYSLIB0014 // ServicePointManager is obsolete
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
#pragma warning restore SYSLIB0014 // ServicePointManager is obsolete
#pragma warning restore CA5386 // Avoid hardcoding SecurityProtocolType value
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Test.Utilities/CSharpSecurityCodeFixVerifier`2+Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ static Test()
// reasonable TLS protocol version for outgoing connections.
#pragma warning disable CA5364 // Do Not Use Deprecated Security Protocols
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable SYSLIB0014 // ServicePointManager is obsolete
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
#pragma warning restore SYSLIB0014 // ServicePointManager is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5364 // Do Not Use Deprecated Security Protocols
{
#pragma warning disable CA5386 // Avoid hardcoding SecurityProtocolType value
#pragma warning disable SYSLIB0014 // ServicePointManager is obsolete
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
#pragma warning restore SYSLIB0014 // ServicePointManager is obsolete
#pragma warning restore CA5386 // Avoid hardcoding SecurityProtocolType value
}
}
Expand Down

0 comments on commit 4d3ab63

Please sign in to comment.