tnblog
首页
视频
资源
登录

记录一下postman 正常返回 c# 模拟https 请求出现The request was aborted: Could not create SSL/TLS secure channel.

1357人阅读 2023/7/24 14:02 总访问:78478 评论:0 收藏:0 手机
分类: .NET

在发送请求前加入如下代码:
//始终验证服务器证书

ServicePointManager.ServerCertificateValidationCallback =
(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => { return true;};
//设置协议
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3  |
                                      SecurityProtocolType.Tls12 |
                                      SecurityProtocolType.Tls11 |
                                      SecurityProtocolType.Tls;

评价
此时幽梦远,不觉到山边!!!
排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
欢迎加群交流技术