使用 ECDSA 证书从 url 获取 xml 文档

Getting xml document from url with ECDSA certificate

我需要来自具有 ECDSA 证书的 Url 的 XML。 当我尝试获取此信息时,出现错误:

The request was aborted: Could not create SSL/TLS secure channel

我试过了:

ServicePointManager.ServerCertificateValidationCallback = (snder, cert, chain, error) => true;

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

但还是一样的错误。

最后通过添加此行修复它:

//设置安全协议为SL12否则returns报错 ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | (安全协议类型)3072;