@@ -426,18 +426,6 @@ internal SqlConnectionString(string connectionString) : base(connectionString, G
426
426
}
427
427
}
428
428
429
- if ( _encrypt == SqlConnectionEncryptOption . Optional )
430
- { // Support legacy registry encryption settings
431
- const string folder = "Software\\ Microsoft\\ MSSQLServer\\ Client\\ SuperSocketNetLib" ;
432
- const string value = "Encrypt" ;
433
-
434
- object obj = ADP . LocalMachineRegistryValue ( folder , value ) ;
435
- if ( ( obj is int iObj ) && ( iObj == 1 ) )
436
- { // If the registry key exists
437
- _encrypt = SqlConnectionEncryptOption . Mandatory ;
438
- }
439
- }
440
-
441
429
if ( null != _networkLibrary )
442
430
{ // MDAC 83525
443
431
string networkLibrary = _networkLibrary . Trim ( ) . ToLower ( CultureInfo . InvariantCulture ) ;
@@ -454,6 +442,18 @@ internal SqlConnectionString(string connectionString) : base(connectionString, G
454
442
}
455
443
#endif // NETFRAMEWORK
456
444
445
+ if ( _encrypt == SqlConnectionEncryptOption . Optional )
446
+ { // Support legacy registry encryption settings
447
+ const string folder = "Software\\ Microsoft\\ MSSQLServer\\ Client\\ SuperSocketNetLib" ;
448
+ const string value = "Encrypt" ;
449
+
450
+ object obj = ADP . LocalMachineRegistryValue ( folder , value ) ;
451
+ if ( ( obj is int iObj ) && ( iObj == 1 ) )
452
+ { // If the registry key exists
453
+ _encrypt = SqlConnectionEncryptOption . Mandatory ;
454
+ }
455
+ }
456
+
457
457
ValidateValueLength ( _applicationName , TdsEnums . MAXLEN_APPNAME , KEY . Application_Name ) ;
458
458
ValidateValueLength ( _currentLanguage , TdsEnums . MAXLEN_LANGUAGE , KEY . Current_Language ) ;
459
459
ValidateValueLength ( _dataSource , TdsEnums . MAXLEN_SERVERNAME , KEY . Data_Source ) ;
0 commit comments