远程主机在 authorize.net 中强行关闭了现有连接

An existing connection was forcibly closed by the remote host in authorize.net

我正在尝试在位于 url https://github.com/AuthorizeNet/sample-code-csharp/tree/40526f6e763825447ff934ac03eff464bd5dad8a

的 c# 中测试 authorize.net 的一些示例

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

An existing connection was forcibly closed by the remote host error code: 10054

这是我遇到的异常:

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

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