I want to specify an ssl certificate for a web socket client to use when connecting to a web socket server.
The only constructor for a System.Net.WebSockets.ClientWebSocket
has 0 parameters. I would expect there to be an override with (Options) as a parameter but there is not.
The ConnectAsync method has 2 parameters: Uri
and CancellationToken
. I would expect there to be an override with (Uri, CancellationToken, Options)
but there is not.
The ClientWebSocket
Options property is get but not set, so i cannot call
ws.options = MyClientWebSocketOptions
There is no SetOptions
method on the ClientWebSocket
class.
The ClientWebSocketOptions class has a ClientCertificates property that is is set-able, so I have assumed this is the way to specify the certificate.
I can create a ClientWebSocketOptions
with the correct certificate, but i need to know how to make a ClientWebSocket
use those options.