Search code examples
c#xmlecdsa

Getting xml document from url with ECDSA certificate


I need the XML from an Url that has an ECDSA certifcate. When I try to get this, I get the error:

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

I tried:

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

and

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

and

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

but still the same error.


Solution

  • Finally fixed it by adding this row:

    //Set the security protocol to SL12 otherwise it returns an error ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | (SecurityProtocolType)3072;