I ran into the same error message while using the ChargifyNET.dll to communicate with the Chargify API. Adding chargify.ProtocolType = SecurityProtocolType.Tls12; to the configuration solved the problem for me.
Here is the complete code snippet:
public ChargifyConnect GetChargifyConnect()
{
var chargify = new ChargifyConnect();
chargify.apiKey = ConfigurationManager.AppSettings["Chargify.apiKey"];
chargify.Password = ConfigurationManager.AppSettings["Chargify.apiPassword"];
chargify.URL = ConfigurationManager.AppSettings["Chargify.url"];
// Without this an error will be thrown.
chargify.ProtocolType = SecurityProtocolType.Tls12;
return chargify;
}
This happened to me when an web request endpoint was switched to another server that accepted TLS1.2 requests only. Tried so many attempts mostly found on Stackoverflow like
Registry Keys ,
Added :
System.Net.ServicePointManager.SecurityProtocol |=
System.Net.SecurityProtocolType.Tls12; to Global.ASX OnStart,
Added in Web.config.
Updated .Net framework to 4.7.2
Still getting same Exception.
The exception received did no make justice to the actual problem I was facing and found no help from the service operator.
To solve this I have to add a new Cipher Suite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
I have used IIS Crypto 2.0 Tool from here as shown below.