以下是网上找到的解决方案:
1. request.ProtocolVersion = HttpVersion.Version10;
2. ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
3.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
4.换个UserAgent试试
5.在App.config中添加以下内容:
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true"/>
</settings>
</system.net>
————————————————
推荐第1种方案
本文提供了五种解决TLS连接问题的方法,包括修改HTTP版本、证书验证、更改UserAgent、配置安全协议及调整App.config设置,旨在帮助开发者有效解决网络请求中的TLS相关错误。
920

被折叠的 条评论
为什么被折叠?



