iOS dev
iOS dev

Reputation: 2284

AFNetworking 3.2.0 'a security policy configured with can only be applied on a manager with a secure base url (i.e. https)

Recently I have updated my iOS App's AFNetworking pods from 3.1.0 to 3.2.0. AFNetworking3.2.0 Having issues like Crashing the app withe bellow error

Terminating app due to uncaught exception 'Invalid Security Policy', reason: 'A security policy configured withAFSSLPinningModeCertificatecan only be applied on a manager with a secure base URL (i.e. https)'

After Executing code then the app Crashed

Which is working fine when switch back to old version with AFNetworking_3.1.0 But crashing on 3.2.0

I also trying operation.securityPolicy.allowInvalidCertificates = YES; But no use

Please guide m is there anything else I need to improve upon for AFNetwrking3.2.0.

Upvotes: 1

Views: 989

Answers (1)

iamsimranjot
iamsimranjot

Reputation: 31

Check out this Pull request: https://github.com/AFNetworking/AFNetworking/pull/3687

It clearly mentions that AFHTTPSessionManager instance configured with an insecure http base URL will throw an exception.

To use AFHTTPSessionManager from 3.2.0 onwards you'll have to switch to a secure https base URL if you are setting the security policy configured with AFSSLPinningModeCertificate or AFSSLPinningModePublicKey

Upvotes: 2

Related Questions