I want to allow invalid SSL certificates with AFNetworking

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

    I extended AFHTTPSessionManager in my code. When testing against a test server, all I need is adding a single line like this:

    mySessionManager.securityPolicy.allowInvalidCertificates = YES;
    
    0 讨论(0)
提交回复
热议问题