我正在尝试在位于此网址{cn}的c#中为authorize.net测试一些示例<{3}}
每当我发布一些样本时,我都会收到此错误:
远程主机强行关闭现有连接 错误代码:10054
这是我得到的例外:
https://github.com/AuthorizeNet/sample-code-csharp/tree/40526f6e763825447ff934ac03eff464bd5dad8a
答案 0 :(得分:1)
您使用的是什么版本的.Net框架?如果您使用的是.Net framework 4.5,请尝试在您创建webrequest的函数的开头添加以下内容:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;