diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 011dee00d..e5e5398f2 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -2136,12 +2136,16 @@ private void setClientStream () false, conf.ServerCertificateValidationCallback, conf.ClientCertificateSelectionCallback); - - sslStream.AuthenticateAsClient ( - host, - conf.ClientCertificates, - conf.EnabledSslProtocols, - conf.CheckCertificateRevocation); + + // The connection couldn't be established if the certificates are empty + if (conf.ClientCertificates != null) + sslStream.AuthenticateAsClient( + host, + conf.ClientCertificates, + conf.EnabledSslProtocols, + conf.CheckCertificateRevocation); + else + sslStream.AuthenticateAsClient(host); _stream = sslStream; }