首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >System.IO.IOException:无法将数据写入传输连接:现有连接已被远程主机强制关闭

System.IO.IOException:无法将数据写入传输连接:现有连接已被远程主机强制关闭
EN

Stack Overflow用户
提问于 2014-02-21 11:57:24
回答 2查看 7.9K关注 0票数 1

我一直在尝试使用SSLstream连接到服务器。我有连接的证书&所有的证书都是正确的。但不知何故,它得到了如下错误:

代码语言:javascript
复制
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

请帮我解决这个错误。提前谢谢。

EN

回答 2

Stack Overflow用户

发布于 2014-04-10 22:05:54

我认为您可能需要检查您正在尝试连接的服务器是否列入了黑名单/阻止了您的IP。这看起来像是阻止/拒绝通信的东西。当我的sftp服务器阻塞了运行客户端的IP时,我也遇到了类似的错误。HTH Fed

票数 0
EN

Stack Overflow用户

发布于 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 ??

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21924995

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档