ios - AFNetworking SSL Request -
i user af send https request
[self.manager post:downloadurlstirng parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { if (success) success(responseobject,passparameters); } failure:^(afhttprequestoperation *operation, nserror *error) { if(failure) failure(operation.responseobject,error,passparameters); }];
and have set securitypolicy yes
self.manager.requestserializer = [afjsonrequestserializer serializer]; self.manager.securitypolicy.allowinvalidcertificates = openssl;
but still got code -1012 , error_message : in order validate domain name self signed certificates, must use pinning.
this sets security policy allow invalid certificates , stops domain name validation also.:
afsecuritypolicy *securitypolicy = [afsecuritypolicy policywithpinningmode:afsslpinningmodenone]; securitypolicy.allowinvalidcertificates = yes; [securitypolicy setvalidatesdomainname:no];
Comments
Post a Comment