1

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?

Lasal Sethiya
  • 201
  • 1
  • 4
  • 17
  • What third-party Web API are you using? Could you provide some key code about calling the third-party Web API for us to reproduce this issue. – Bruce Chen Jan 19 '17 at 07:34

1 Answers1

5

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.

Community
  • 1
  • 1
Bruce Chen
  • 18,207
  • 2
  • 21
  • 35