@@ -20,6 +20,8 @@ namespace SuperSocket.Tests
20
20
{
21
21
public class SecureHostConfigurator : TcpHostConfigurator
22
22
{
23
+ private SslProtocols _currentSslProtocols ;
24
+
23
25
public SecureHostConfigurator ( )
24
26
{
25
27
WebSocketSchema = "wss" ;
@@ -34,12 +36,22 @@ public override void Configure(ISuperSocketHostBuilder hostBuilder)
34
36
{
35
37
var listener = options . Listeners [ 0 ] ;
36
38
37
- listener . AuthenticationOptions = new ServerAuthenticationOptions
39
+ var authenticationOptions = listener . AuthenticationOptions ;
40
+
41
+ if ( authenticationOptions == null )
38
42
{
39
- FilePath = "supersocket.pfx" ,
40
- Password = "supersocket" ,
41
- EnabledSslProtocols = GetServerEnabledSslProtocols ( )
42
- } ;
43
+ authenticationOptions = listener . AuthenticationOptions = new ServerAuthenticationOptions ( ) ;
44
+ }
45
+
46
+ authenticationOptions . FilePath = "supersocket.pfx" ;
47
+ authenticationOptions . Password = "supersocket" ;
48
+
49
+ if ( authenticationOptions . EnabledSslProtocols == SslProtocols . None )
50
+ {
51
+ authenticationOptions . EnabledSslProtocols = GetServerEnabledSslProtocols ( ) ;
52
+ }
53
+
54
+ _currentSslProtocols = authenticationOptions . EnabledSslProtocols ;
43
55
} ) ;
44
56
} ) ;
45
57
@@ -63,7 +75,7 @@ protected virtual SslProtocols GetServerEnabledSslProtocols()
63
75
64
76
protected virtual SslProtocols GetClientEnabledSslProtocols ( )
65
77
{
66
- return SslProtocols . Tls13 | SslProtocols . Tls12 ;
78
+ return _currentSslProtocols ;
67
79
}
68
80
69
81
public override IEasyClient < TPackageInfo > ConfigureEasyClient < TPackageInfo > ( IPipelineFilter < TPackageInfo > pipelineFilter , ConnectionOptions options )
0 commit comments