SocketIO4Net - Error initializing handshake with https://localhost/

三世轮回 提交于 2020-01-06 14:37:07

问题


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.


回答1:


.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; }



来源:https://stackoverflow.com/questions/36792240/socketio4net-error-initializing-handshake-with-https-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!