I put the .cer certificate used by the Apache Server in the Xcode project. When the app tries to talk to the server I get this error in Xcode:
Assertion fail
It looks like your certificate file is not in the right format. Your code fails at these lines (AFURLConnectionOperation/pinnedPublicKeys):
SecCertificateRef allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)data);
NSParameterAssert(allowedCertificate);
I had the same error (on AFNetworking 1.1, but the version should not matter), when my certificate was looking like this:
-----BEGIN CERTIFICATE-----
..
-----END CERTIFICATE-----
I managed to resolve this by converting the certificate to x509 format, using the command from this answer:
openssl x509 -in adn.crt -outform der -out "adn.der"
Afterwards I renamed adn.der back to adn.cer ('.cer' seems to be the expected extension for AFNetworking), and everything works well now.