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

♀尐吖头ヾ 提交于 2020-05-09 07:54:09

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/61525821/afnetworking-3-2-0-a-security-policy-configured-with-can-only-be-applied-on-a-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!