【问题标题】:An existing connection was forcibly closed by the remote host in authorize.netauthorize.net 中的远程主机强行关闭了现有连接
【发布时间】:2017-12-22 23:11:09
【问题描述】:

我正在尝试在位于此 url https://github.com/AuthorizeNet/sample-code-csharp/tree/40526f6e763825447ff934ac03eff464bd5dad8a 的 c# 中测试 authorize.net 的一些示例

每当我启动一些示例时,我都会收到此错误:

现有连接被远程主机强行关闭 错误代码:10054

这是我得到的例外:

【问题讨论】:

标签: c# authorize.net


【解决方案1】:

您使用的是哪个版本的 .Net 框架?如果您使用的是 .Net framework 4.5,请尝试在发出 Web 请求的函数开头添加以下内容:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-12
    相关资源
    最近更新 更多