File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed 
src/Microsoft.Data.SqlClient 
netcore/src/Microsoft/Data/SqlClient 
src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -405,11 +405,12 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
405405            uint  returnValue  =  SNINativeMethodWrapper . SNIWaitForSSLHandshakeToComplete ( Handle ,  GetTimeoutRemaining ( ) ,  out  uint  nativeProtocolVersion ) ; 
406406            var  nativeProtocol  =  ( NativeProtocols ) nativeProtocolVersion ; 
407407
408+ #pragma warning disable CA5398  // Avoid hardcoded SslProtocols values 
408409            if  ( nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_TLS1_2_CLIENT )  ||  nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_TLS1_2_SERVER ) ) 
409410            { 
410411                protocolVersion  =  ( int ) SslProtocols . Tls12 ; 
411412            } 
412- #if NET6_0_OR_GREATER 
413+ #if NET6_0_OR_GREATER   
413414            else  if  ( nativeProtocol . HasFlag ( NativeProtocols . SP_PROT_TLS1_3_CLIENT )  ||  nativeProtocol. HasFlag( NativeProtocols . SP_PROT_TLS1_3_SERVER ) ) 
414415            { 
415416                /* The SslProtocols.Tls13 is supported by netcoreapp3.1 and later */ 
@@ -439,6 +440,7 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
439440            { 
440441                protocolVersion  =  ( int ) SslProtocols . None ; 
441442            } 
443+ #pragma warning restore CA5398  // Avoid hardcoded SslProtocols values  
442444            return  returnValue ; 
443445        } 
444446
Original file line number Diff line number Diff line change @@ -767,6 +767,7 @@ private static string ToFriendlyName(this SslProtocols protocol)
767767            { 
768768                name = "TLS 1.3"; 
769769            }*/ 
770+ #pragma warning disable CA5398  // Avoid hardcoded SslProtocols values 
770771            if  ( ( protocol  &  SslProtocols . Tls12 )  ==  SslProtocols . Tls12 ) 
771772            { 
772773                name  =  "TLS 1.2" ; 
@@ -795,6 +796,7 @@ private static string ToFriendlyName(this SslProtocols protocol)
795796            { 
796797                name  =  "SSL 2.0" ; 
797798            } 
799+ #pragma warning restore CA5398  // Avoid hardcoded SslProtocols values 
798800            else 
799801            { 
800802#if ! NETFRAMEWORK 
@@ -818,9 +820,11 @@ public static string GetProtocolWarning(this SslProtocols protocol)
818820#if NET8_0_OR_GREATER 
819821#pragma warning disable SYSLIB0039  // Type or member is obsolete: TLS 1.0 & 1.1 are deprecated 
820822#endif
821- #pragma warning disable CS0618  // Type or member is obsolete : SSL is depricated 
823+ #pragma warning disable CS0618  // Type or member is obsolete : SSL is deprecated 
824+ #pragma warning disable CA5398  // Do not use deprecated SslProtocols values 
822825            if  ( ( protocol  &  ( SslProtocols . Ssl2  |  SslProtocols . Ssl3  |  SslProtocols . Tls  |  SslProtocols . Tls11 ) )  !=  SslProtocols . None ) 
823- #pragma warning restore CS0618  // Type or member is obsolete : SSL is depricated 
826+ #pragma warning restore CA5398  // Do not use deprecated SslProtocols values 
827+ #pragma warning restore CS0618  // Type or member is obsolete : SSL is deprecated 
824828#if NET8_0_OR_GREATER 
825829#pragma warning restore SYSLIB0039  // Type or member is obsolete: SSL and TLS 1.0 & 1.1 is deprecated 
826830#endif
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments