2

I have an iPhone app , that needs to make secure connection to my webservice

I have a CA which i created and want to add to the app, so that it creates the connection and authenticates my server

I am using restkit 0.20.3 to make the requests.

How do i configure the AFHHTTPClient to trust my certificate ?

Lena Bru
  • 13,521
  • 11
  • 61
  • 126

1 Answers1

0

Only adding the your URL as https:// formate will do because your information will be encrypted based on the SSL certificate

In ASIHttpRequest Client certificates support If your server requires the use of client certificates, as of v1.8 it is now possible to send them with your request.

// Will send the certificate attached to the identity (identity is a SecIdentityRef)
[request setClientCertificateIdentity:identity];



// Add an additional certificate (where cert is a SecCertificateRef)
[request setClientCertificates:[NSArray arrayWithObject:(id)cert]];

There is a helper function in ClientCertificateTests.m in the iPhone / iPad sample app that can create a SecIdentityRef from PKCS12 data (this function only works on iOS).

and look here for more info about handling the self signed certificate at iOS end:

Use a self-signed ssl certificate in an iphone app

iPhone: install certificate for SSL connection

Community
  • 1
  • 1
Retro
  • 3,985
  • 2
  • 17
  • 41