I want to allow invalid SSL certificates with AFNetworking

前端 未结 13 719
南笙
南笙 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;
    

提交回复
热议问题