The request was aborted: Could not create SSL/TLS

2019-07-23 16:30发布

My webApi is using a third party web api Service inside it. The thing is it's perfectly working in my local machine and Azure web Service. but when I transfer this solution in to Azure Vm instance it's getting this error. I have installed correct certificates related to that 3rd party web api and registered with HttpClient and tried with

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;

But it's giving the same error. I don't know what is the exact error. Could any one help on this please?

1条回答
Evening l夕情丶
2楼-- · 2019-07-23 16:45

Per my understanding, you could refer to the following approach to check this issue:

1.Leverage https://www.ssllabs.com/ssltest/ to check the supported Protocols both on your side and third-party Web API as follows:

2.Configure SecurityProtocol and ServerCertificateValidationCallback as follows:

ServicePointManager.Expect100Continue = true;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
            | SecurityProtocolType.Tls11
            | SecurityProtocolType.Tls12
            | SecurityProtocolType.Ssl3;

Also, you could refer to this similar issue1 and issue2 for more details.

查看更多
登录 后发表回答