I want to allow invalid SSL certificates with AFNetworking

前端 未结 13 735
南笙
南笙 2020-12-02 10:11

I want to allow invalid SSL certificates. My main code is below:

myClient = [[MyClient alloc] init];
[myClient getHtml:@\"/path/to/the/distination.html\"];
<         


        
13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 10:40

    You can now use the allowsInvalidSSLCertificate property of the AFHTTPClient. No need to use defines in the latest versions of AFNetworking.

    AFHTTPClient* client = [AFHTTPClient clientWithBaseURL:@"url"];
    client.allowsInvalidSSLCertificate = YES; //this defaults to no
    

提交回复
热议问题