I want to allow invalid SSL certificates with AFNetworking

前端 未结 13 706
南笙
南笙 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:56

    if you are using RestKit using

    client.allowsInvalidSSLCertificate = YES;
    

    won't work, instead do this:

    in your project, click on RestKit.xcodeproj go to project > Build Settings > Preprocessor Macros

    and add _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_=1

    thats finished.

提交回复
热议问题