Skip to content

Commit

Permalink
Forcing TLS 1.2 for websocket connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Oxtoby committed Mar 11, 2020
1 parent 38406ad commit 17908cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SlackNet/IWebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface IWebSocket : IDisposable
IObservable<string> Messages { get; }
}

class WebSocketWrapper : IWebSocket
public class WebSocketWrapper : IWebSocket
{
private readonly WebSocket _webSocket;

Expand Down
5 changes: 3 additions & 2 deletions SlackNet/WebSocketFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using WebSocket4Net;
using System.Security.Authentication;
using WebSocket4Net;

namespace SlackNet
{
Expand All @@ -9,6 +10,6 @@ public interface IWebSocketFactory

class WebSocketFactory : IWebSocketFactory
{
public IWebSocket Create(string uri) => new WebSocketWrapper(new WebSocket(uri));
public IWebSocket Create(string uri) => new WebSocketWrapper(new WebSocket(uri, sslProtocols: SslProtocols.Tls12));
}
}

0 comments on commit 17908cf

Please sign in to comment.