Is there any way to implement client certificate authentication using CFNetwork?

233 Views Asked by At

I want to implement http requests using CFNetwork instead of NSURLConnection or NSURLSession, but server requires client certificate authentication challenge. Unfortunately I've not figured out how to implement client certificate authentication. I've checked CFNetwork programming guide, i've seen below information:

CFHTTPAuthentication supports the following authentication schemes:

  • Basic
  • Digest
  • NT LAN Manager (NTLM)
  • Simple and Protected GSS-API Negotiation Mechanism (SPNEGO)

Does it mean that we cannot implement client certificate authentication using CFNetwork?

Thanks in advance...

1

There are 1 best solutions below

0
On

I'm about 75% sure that if you put the user's key and client certificate in the keychain, the underlying NSCFURL code will automatically use them even if you're using the CF interfaces to make the request.

If that doesn't work, then no, I don't think it is possible without using Foundation calls (or libcurl if you absolutely have to avoid Objective-C).