Skip to content

Commit 345c9d7

Browse files
authored
Fix websocket protocol selection, tls1.2 (#41)
* Web view correctly detects websocket protocol * use tls1.2
1 parent dc36f6e commit 345c9d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dpp.opentakrouter/TakService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Task StartAsync(CancellationToken cancellationToken)
5252
var tlsServerConfig = configuration.GetSection("server:tak:tls").Get<TakServerConfig>();
5353
if (tlsServerConfig is not null && tlsServerConfig.Enabled)
5454
{
55-
var sslContext = new SslContext(SslProtocols.Tls, new X509Certificate(
55+
var sslContext = new SslContext(SslProtocols.Tls12, new X509Certificate(
5656
tlsServerConfig.Cert,
5757
tlsServerConfig.Passphrase)
5858
);
@@ -76,7 +76,7 @@ public Task StartAsync(CancellationToken cancellationToken)
7676
var port = websocketConfig.Port ?? 5500;
7777
if (websocketConfig.Ssl)
7878
{
79-
var sslContext = new SslContext(SslProtocols.Tls, new X509Certificate(
79+
var sslContext = new SslContext(SslProtocols.Tls12, new X509Certificate(
8080
websocketConfig.Cert,
8181
websocketConfig.Passphrase)
8282
);

dpp.opentakrouter/Views/Home/Map.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
}
7474
7575
function Connect() {
76-
var proto = window.location.protocol == "https" ? "wss" : "ws";
76+
var proto = window.location.protocol == "https:" ? "wss" : "ws";
7777
var wsEndpoint = `${proto}://${window.location.hostname}:@ViewData["ws-port"]`;
7878
var ws = new WebSocket(wsEndpoint);
7979

0 commit comments

Comments
 (0)