I'm working on an iOS app, and we'd like to secure our private API trough SSL.
Everything is fine on server-side, and our Android app already connects to HTTPS. On iOS, on the other side, I'm stuck.
I'm using AFNetworking, so :
- As this topic explains, I simply added our .cer file to my bundle
- Since we use a self-signed certificate, I also added :
_
AFHTTPRequestOperationManager *requestManager = [AFHTTPRequestOperationManager manager];
requestManager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
requestManager.securityPolicy.allowInvalidCertificates = YES;
Certificate is found by AFNetworking, but our server refuses the authentication, and returns an ugly 400.
Since I'm reaaally new to SSL, any tips on how to find where this fails would be greatly appreciated. Can we log something server-side or anything like that to "investigate"?