0

I'm trying to use SocketIO4Net to connect with my node.js server via socket.io.

Can't seem to get it to work, when it comes to HTTPS. Getting this: Error initializing handshake with https://localhost/

Couldn't find a solution in other similar questions. If you have other solutions to connect to socket.io sockets from C# feel free to share the information.

R4Ynz
  • 41
  • 1
  • 5

1 Answers1

0

.NET seems to block my self signed certificate. Implementing the RemoteCertificateValidationCallback seems to solve the problem.

ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(pass);

private static bool pass(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) { return true; }

R4Ynz
  • 41
  • 1
  • 5