Making request using httpClient over https to an endpoint with invalid certificate

FinHorsleyFinHorsley USMember ✭✭

"NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)" - is there a workaround to this without just creating a validated certificate?

Answers

  • andnesandnes USMember ✭✭✭

    Try this:

    ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicy) => true);

  • FinHorsleyFinHorsley USMember ✭✭

    I've tried this although it makes no difference. I have a static HttpRequestClass with a static httpClient property. From the testing I have done setting the ValidationCallback as true only works if I don't set the httpClient's baseAddress

Sign In or Register to comment.