2

My server is a running using SuperWebSocket with the following code for the server:

var server = new WebSocketServer();
var config = new ServerConfig();
config.Port = 4015;
config.Security = "Tls";
config.Certificate = new CertificateConfig{
    FilePath = serverConfiguration.Certificate.Path,
    ClientCertificateRequired = true
}            
server.Setup(config);
server.Start();

For client I am trying to use WebSocket4Net and I am trying to configure the certificate the client should present without any luck the current client code is:

var client = new WebSocket("wss://localhost:4015, "basic", WebSocketVersion.Rfc6455);
client.Open();

1 Answers1

1

As you stated in server configuration, your client needs to authenticate with a certificate. But I can't see any certificate in your client connection.

As a matter of fact, I can see no way to specify those certificates. I browsed the sources on github and found out that SuperWebSocket4Net is built on SuperSocket ClientEngine (from the same author). In the ClientEngine there's a class named SslStreamTcpSession. Here the SLL client is created and used for authentication, and here you can put your certificates. Maybe we can ask the author to add a feature: the chance to set the certificates for client auth.

Ratman
  • 156
  • 1
  • 6
  • 1
    I finally managed to put some code change in SuperWebSocket4Net as stated before, and I can now use WSS (secure web sockets) successfully. If anyone is interested I can share my hacks. – Ratman Nov 18 '15 at 17:01
  • 2
    I'm interested. Please share your hacks. - Kalyan – kalyanswaroop Feb 03 '16 at 20:41