File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
src/Microsoft.Data.SqlClient
netcore/src/Microsoft/Data/SqlClient
src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -822,13 +822,14 @@ private static string ToFriendlyName(this SslProtocols protocol)
822822 {
823823 name = "TLS 1.0" ;
824824 }
825- #pragma warning disable CS0618 // Type or member is obsolete: SSL is depricated
825+ // SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
826+ #pragma warning disable CS0618 , CA5397
826827 else if ( ( protocol & SslProtocols . Ssl3 ) == SslProtocols . Ssl3 )
827828 {
828829 name = "SSL 3.0" ;
829830 }
830831 else if ( ( protocol & SslProtocols . Ssl2 ) == SslProtocols . Ssl2 )
831- #pragma warning restore CS0618 // Type or member is obsolete: SSL is depricated
832+ #pragma warning restore CS0618 , CA5397
832833 {
833834 name = "SSL 2.0" ;
834835 }
@@ -848,9 +849,10 @@ private static string ToFriendlyName(this SslProtocols protocol)
848849 public static string GetProtocolWarning ( this SslProtocols protocol )
849850 {
850851 string message = string . Empty ;
851- #pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
852+ // SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
853+ #pragma warning disable CS0618 , CA5397
852854 if ( ( protocol & ( SslProtocols . Ssl2 | SslProtocols . Ssl3 | SslProtocols . Tls | SslProtocols . Tls11 ) ) != SslProtocols . None )
853- #pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
855+ #pragma warning restore CS0618 , CA5397
854856 {
855857 message = StringsHelper . Format ( Strings . SEC_ProtocolWarning , protocol . ToFriendlyName ( ) ) ;
856858 }
Original file line number Diff line number Diff line change @@ -413,13 +413,14 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
413413 }
414414 else if ( nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_SSL3_CLIENT ) || nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_SSL3_SERVER ) )
415415 {
416- #pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
416+ // SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
417+ #pragma warning disable CS0618 , CA5397
417418 protocolVersion = ( int ) SslProtocols . Ssl3 ;
418419 }
419420 else if ( nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_SSL2_CLIENT ) || nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_SSL2_SERVER ) )
420421 {
421422 protocolVersion = ( int ) SslProtocols . Ssl2 ;
422- #pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
423+ #pragma warning restore CS0618 , CA5397
423424 }
424425 else //if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_NONE))
425426 {
Original file line number Diff line number Diff line change @@ -243,7 +243,13 @@ private bool VerifyHealthReportAgainstRootCertificate(X509Certificate2Collection
243243 chain . ChainPolicy . ExtraStore . Add ( cert ) ;
244244 }
245245
246+ // An Always Encrypted-enabled driver doesn't verify an expiration date or a certificate authority chain.
247+ // A certificate is simply used as a key pair consisting of a public and private key. This is by design.
248+
249+ #pragma warning disable IA5352
250+ // CodeQL [SM00395] By design. Always Encrypted certificates should not be checked.
246251 chain . ChainPolicy . RevocationMode = X509RevocationMode . NoCheck ;
252+ #pragma warning restore IA5352
247253
248254 if ( ! chain . Build ( healthReportCert ) )
249255 {
You can’t perform that action at this time.
0 commit comments