系统win10 及以下:
1. 先用IISCrypto.exe 开启 tls1.2 1.3 之类。
2. 代码中使用
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12| SecurityProtocolType.Tls13;
// 跳过https 证书校验
ServicePointManager.ServerCertificateValidationCallback = (sender1, certificate, chain, errors) => true;
3. net 4.6以上 使用 (类似)
HttpClientHandler handler = new HttpClientHandler();
handler.SslProtocols =System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls11;
handler.ServerCertificateCustomValidationCallback = CheckSSL;
HttpClient client = new HttpClient(handler);
4. 上述都做了还出现如下类似的错误
请求的安全协议不受支持