I have a web application integrated to some services and APIs. Some of these services, unfortunately, only supports communication through TLS 1.1, but the newer ones require TLS 1.2.
I have tried to add the following initialization code:
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12
Or even a complete list of supported protocols:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12
In both cases, it seems that the framework only tries to use Tls12. When I try to communicate to the older services, the following exception is thrown:
The request was aborted: Could not create SSL/TLS secure channel.
How to keep the both protocols enabled? I am hoping to find a solution that could activate some kind of automatic fallback…