| 
4 | 4 | 
 
  | 
5 | 5 | using System.Collections.Generic;  | 
6 | 6 | using System.IO;  | 
 | 7 | +using System.Security.Authentication;  | 
7 | 8 | using Microsoft.SqlServer.TDS.PreLogin;  | 
8 | 9 | 
 
  | 
9 | 10 | namespace Microsoft.Data.SqlClient.ManualTesting.Tests.DataCommon  | 
@@ -32,11 +33,11 @@ public ConnectionTestParametersData()  | 
32 | 33 |             // Test cases possible field values for connection parameters:  | 
33 | 34 |             // These combinations are based on the possible values of Encrypt, TrustServerCertificate, Certificate, HostNameInCertificate  | 
34 | 35 |             /*  | 
35 |  | -             * TDSEncryption | Encrypt    | TrustServerCertificate | Certificate  | HNIC         | TestResults  | 
36 |  | -             * ----------------------------------------------------------------------------------------------  | 
37 |  | -             *   Off         | Optional   |  true                  | valid        | valid name   | true  | 
38 |  | -             *   On          | Mandatory  |  false                 | mismatched   | empty        | false  | 
39 |  | -             *   Required    |            |    x                   | ChainError?  | wrong name?  |   | 
 | 36 | +             * TDSEncryption | Encrypt    | TrustServerCertificate | Certificate  | HNIC         | SSL Protocols    | TestResults  | 
 | 37 | +             * ---------------------------------------------------------------------------------------------------------------  | 
 | 38 | +             *   Off         | Optional   |  true                  | valid        | valid name   | TLS 1.2          | true  | 
 | 39 | +             *   On          | Mandatory  |  false                 | mismatched   | empty        | TLS 1.0, TLS 1.1 | false  | 
 | 40 | +             *   Required    |            |    x                   | ChainError?  | wrong name?  |                  |  | 
40 | 41 |              */  | 
41 | 42 |             ConnectionTestParametersList = new List<ConnectionTestParameters>  | 
42 | 43 |             {  | 
@@ -78,6 +79,21 @@ public ConnectionTestParametersData()  | 
78 | 79 |                 new(TDSPreLoginTokenEncryptionType.On, SqlConnectionEncryptOption.Mandatory, true, s_mismatchedcert, _empty, true),  | 
79 | 80 |                 new(TDSPreLoginTokenEncryptionType.Required, SqlConnectionEncryptOption.Mandatory, false, s_mismatchedcert, _empty, false),  | 
80 | 81 |                 new(TDSPreLoginTokenEncryptionType.Required, SqlConnectionEncryptOption.Mandatory, true, s_mismatchedcert, _empty, true),  | 
 | 82 | + | 
 | 83 | +                // Multiple SSL protocols test  | 
 | 84 | +#pragma warning disable CA5397 // Do not use deprecated SslProtocols values  | 
 | 85 | +#pragma warning disable CA5398 // Avoid hardcoded SslProtocols values  | 
 | 86 | +#if NET  | 
 | 87 | +#pragma warning disable SYSLIB0039 // Type or member is obsolete: TLS 1.0 & 1.1 are deprecated  | 
 | 88 | +#endif  | 
 | 89 | +                new(TDSPreLoginTokenEncryptionType.Off, SqlConnectionEncryptOption.Mandatory, false, s_fullPathToCer, _empty, SslProtocols.Tls | SslProtocols.Tls11, true),  | 
 | 90 | +                new(TDSPreLoginTokenEncryptionType.On, SqlConnectionEncryptOption.Mandatory, false, s_fullPathToCer, _empty, SslProtocols.Tls | SslProtocols.Tls11, true),  | 
 | 91 | +                new(TDSPreLoginTokenEncryptionType.Required, SqlConnectionEncryptOption.Mandatory, false, s_fullPathToCer, _empty, SslProtocols.Tls | SslProtocols.Tls11, true),  | 
 | 92 | +#if NET  | 
 | 93 | +#pragma warning restore SYSLIB0039 // Type or member is obsolete: TLS 1.0 & 1.1 are deprecated  | 
 | 94 | +#endif  | 
 | 95 | +#pragma warning restore CA5397 // Do not use deprecated SslProtocols values  | 
 | 96 | +#pragma warning restore CA5398 // Avoid hardcoded SslProtocols values  | 
81 | 97 |             };  | 
82 | 98 |         }  | 
83 | 99 |     }  | 
 | 
0 commit comments