请教websocket-sharp的问题?

xyzliuin 2017-09-20 10:51:34
websocket-sharp 需要配置一行:
ws.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls;


在win7下正常工作,windows server 2008却不能工作,报错

An error occured - Message: An exception has occurred while connecting. , Exception: WebSocketSharp.WebSocketException: An error has occurred while handshaking. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
at WebSocketSharp.WebSocket.setClientStream()
--- End of inner exception stack trace ---
at WebSocketSharp.WebSocket.setClientStream()
at WebSocketSharp.WebSocket.doHandshake()
at WebSocketSharp.WebSocket.connect()Connection closed: An error has occurred while handshaking.


请教解决办法
...全文
896 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyzliuin 2017-09-21
  • 打赏
  • 举报
回复
应该就是协议配置的问题,上面的代码在windows server2008 下,可能没有正确执行 有没有知道怎么解决的?
xdashewan 2017-09-21
  • 打赏
  • 举报
回复
握手失败,端口问题?

110,525

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧