我一直在尝试使用SSLstream连接到服务器。我有连接的证书&所有的证书都是正确的。但不知何故,它得到了如下错误:
System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
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 SslTcpClient.Open() in d:\Ishit\Fix\Webservice development - XML communication protocol\Work-by-Developer\ishit\EPP_Webservice\App_Code\SslTcpClient.cs:line 102
at EPP_Transaction_Webservice.Hello() in d:\Ishit\Fix\Webservice development - XML communication protocol\Work-by-Developer\ishit\EPP_Webservice\App_Code\EPP_Transaction_Webservice.cs:line 62
请帮我解决这个错误。提前谢谢。
发布于 2014-04-10 22:05:54
我认为您可能需要检查您正在尝试连接的服务器是否列入了黑名单/阻止了您的IP。这看起来像是阻止/拒绝通信的东西。当我的sftp服务器阻塞了运行客户端的IP时,我也遇到了类似的错误。HTH Fed
发布于 2016-04-29 15:52:34
检查连接加密类型: SSL3?TLS10?TLS11?TLS12?为此,可以使用firefox >页面信息>安全选项卡>技术详细信息
添加波纹线应用程序加载
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
或者
System.Net.ServicePointManager.SecurityProtocol = default:System.Net.SecurityProtocolType.Ssl3 | System.Net.SecurityProtocolType.Tls;
注: Tls11/Tls12 request .net >= v4.5 ??
https://stackoverflow.com/questions/21924995
复制相似问题