I know there has been many questions and answers about this error, but I have tried all suggestions I could find and nothing has worked.
I am using c# WebRequest to connect to an API and I get this error:
The request was aborted: Could not create SSL/TLS secure channel
I tried upgrading from .NET 4.0 to 4.72 and it did not solve.
I tried adding ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12.
Windows Server 2019 with IIS 10.
According to an online SSL test, the target system has TLS 1.3 and TLS 1.2 enabled only.
Cipher Suites:
TLS 1.3 (suites in server-preferred order)
TLS_AES_128_GCM_SHA256 (0x1301) ECDH x25519 (eq. 3072 bits RSA) FS 128
TLS_AES_256_GCM_SHA384 (0x1302) ECDH x25519 (eq. 3072 bits RSA) FS 256
TLS_CHACHA20_POLY1305_SHA256 (0x1303) ECDH x25519 (eq. 3072 bits RSA) FS 256
TLS 1.2 (suites in server-preferred order)
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) ECDH x25519 (eq. 3072 bits RSA) FS 128
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) ECDH x25519 (eq. 3072 bits RSA) FS 256
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8) ECDH x25519 (eq. 3072 bits RSA) FS 256
Is this supported by my server, or anything else I can try?
Current code is:
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13 | SecurityProtocolType.Ssl3;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
WebRequest request = HttpWebRequest.Create(url);
WebResponse response = request.GetResponse();