AFNetWork中使用Https

1.pch中添加

#import   
#import   
#define AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES  

2.在请求前加上

 AFSecurityPolicy *securityPolicy = [AFSecurityPolicy defaultPolicy];  
 securityPolicy.allowInvalidCertificates = YES;  
 [AFHTTPSessionManager manager].securityPolicy = securityPolicy;}  

你可能感兴趣的:(AFNetWork中使用Https)