websocket-client
websocket-client copied to clipboard
TLS 1.2
Hi. How set SslConfiguration in client? Me need set System.Security.Authentication.SslProtocols.Tls12 in WEbSocket client for connect to wss.
Hello @caffreysbb,
did you try to set it through advanced configuration?
I'm having issue with this right now, where in the advanced config can you specify the TLS version? I can't find anything related to TLS in the options or online.
I am stuck with this same issue. Any update on this?
I am stuck with this same issue. Any update on this?
My issue ended up being related to how the native Clientwebsocket sets its headers, turns out it always specifies a few of them and my requests were sending bad header info.
You can specify your tls version in System.Security.Authentication, however as far as I'm aware and after looking into it a bit, it doesnt seem like there's a way to configure the protocol yourself directly on the native implementation of the ClientWebSocket. Seems like you'd need a custom websocket implementation to do it.
How can I specify this in advanced config ? cannot find that variable there.
How can I specify this in advanced config ? cannot find that variable there.
You cannot at the moment with the standard ClientWebSocket, which this library wraps. At least as far as I know. Make sure your issue is directly related to TLS, I thought mine was however it turned out it was not.
Is there any update on this issue? I have a user who is experiencing the exception
System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server
---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.IO.IOException: The read operation failed, see inner exception.
---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
---> System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted
I experienced a similar error related to the HttpClientHandler component, but I managed to solve the issue by
var httpClientHandler = new HttpClientHandler
{
SslProtocols = SslProtocols.Tls12
};
Is it possible to achieve something similar with WebsocketClient?