AFHTTPRequestOperation with self-signed SSL and HTTP Basic Auth (-1012 error)

后端 未结 2 844
南方客
南方客 2021-01-19 04:06

I am trying to upload photo to my web-server via AFHTTPRequestOperation. Here is my AFHTTPSessionManager. All http-requests via this manager<

2条回答
  •  醉话见心
    2021-01-19 05:03

    Here is the solution:

    AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
    policy.allowInvalidCertificates = YES;
    operation.securityPolicy = policy;
    

    So HTTP basic auth data is provided to operation by manager, but SSL policy - not.

提交回复
热议问题