Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AFNetworking https request not working

I try connect to https server, but I get error -1012(NSErrorFailingURLKey). If I try connect to http then all is good. But I should connect to https. What does it can be? I tried connect via AFNetworking v1.0 and v2.0. I used AFHTTPRequestOperation, AFHTTPRequestOperationManager, AFHTTPClient and other. P.S. When I try connect to https via firebug, all is good. I mean, server works good.

like image 495
alex_izh Avatar asked Nov 06 '13 08:11

alex_izh


1 Answers

Try with #define _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_ 1 to allow invalid or self signed certificates.

By default, they are not allowed, see AFURLConnectionOperation.h

like image 64
malinois Avatar answered Oct 11 '22 02:10

malinois