Skip to content

Commit 9325c58

Browse files
committed
fixed the build of unit tests
1 parent c5cb606 commit 9325c58

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

test/WebSocket4Net.Tests/SecureHostConfigurator.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,25 @@ public void Configure(HostBuilderContext context, IServiceCollection services)
2424
services.Configure<ServerOptions>((options) =>
2525
{
2626
var listener = options.Listeners[0];
27-
listener.Security = GetServerEnabledSslProtocols();
28-
listener.CertificateOptions = new CertificateOptions
27+
28+
var authenticationOptions = listener.AuthenticationOptions;
29+
30+
if (authenticationOptions == null)
31+
{
32+
authenticationOptions = listener.AuthenticationOptions = new ServerAuthenticationOptions();
33+
}
34+
35+
authenticationOptions.CertificateOptions = new CertificateOptions
2936
{
3037
FilePath = "supersocket.pfx",
3138
Password = "supersocket"
3239
};
40+
41+
if (authenticationOptions.EnabledSslProtocols == SslProtocols.None)
42+
{
43+
authenticationOptions.EnabledSslProtocols = GetServerEnabledSslProtocols();
44+
}
45+
3346
Listener = listener;
3447
});
3548
}

0 commit comments

Comments
 (0)