C#C
C#2y ago
mynarco

Cannot find RemoteCertificateValidationCallback in ClientWebSocketOptions

Hello i am trying to bypass ssl certs by setting RemoteCertificateValidationCallback in the websocket options but they dont exist?

        Socket = new ClientWebSocket();
        Socket.Options.RemoteCertificateValidationCallback = delegate { return true; };


error:
'ClientWebSocketOptions' does not contain a definition for 'RemoteCertificateValidationCallback' and no accessible extension method 'RemoteCertificateValidationCallback' accepting a first argument of type 'ClientWebSocketOptions' could be found (are you missing a using directive or an assembly reference?)


msdn article: https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocketoptions.remotecertificatevalidationcallback?view=net-8.0#system-net-websockets-clientwebsocketoptions-remotecertificatevalidationcallback
Gets or sets the callback to validate a server certificate.
Was this page helpful?