Paypal开发中遇到请求被中止:|Paypal开发中遇到请求被中止: 未能创建 SSL/TLS 安全通道及解决方案
最近在基于ASP.NET上开发了Paypal支付平台,在ASP.NET开发的过程中没有遇到这个问题,但是引用到MVC开发模式中的时候就出现了“未能创建 SSL/TLS 安全通道及解决方案”的问题;
1/// 2/// 发送请求 3/// 4/// 5///6private static NVPCodec SendExpressCheckoutCommand(NVPCodec nvp) 7{ 8NVPCallerServices service = InitializeServices(); 9string response = service.Call(nvp.Encode()); 10 11NVPCodec responsenvp = new NVPCodec(); 12responsenvp.Decode(response); 13return responsenvp; 14 15}
代码中当编译到 string response = service.Call(nvp.Encode()); 时就会报错,然后查阅了相关资料,当Paypal创建不安全因素的链接时候服务器就会阻止;
解决方案:在编译的代码前面加上
【Paypal开发中遇到请求被中止:|Paypal开发中遇到请求被中止: 未能创建 SSL/TLS 安全通道及解决方案】 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 这句话就可以了。
转载于:https://www.cnblogs.com/BarryJames/p/6179738.html
推荐阅读
- 热闹中的孤独
- Shell-Bash变量与运算符
- JS中的各种宽高度定义及其应用
- 2021-02-17|2021-02-17 小儿按摩膻中穴-舒缓咳嗽
- 深入理解Go之generate
- 异地恋中,逐渐适应一个人到底意味着什么()
- 我眼中的佛系经纪人
- 《魔法科高中的劣等生》第26卷(Invasion篇)发售
- “成长”读书社群招募
- 2020-04-07vue中Axios的封装和API接口的管理