The certificate for this server is invalid

前端 未结 9 1861
花落未央
花落未央 2021-02-13 18:04

I know that if I use following nsurlconnectiondelegate it will be fixed

– connection:willSendRequestForAuthenticationChallenge: – connection:canAuthenti

9条回答
  •  天涯浪人
    2021-02-13 18:56

    If you are using AFNetworking, you can use this code:

    (Just as a temp client-side solution!)

    AFHTTPSessionManager * apiManager = [AFHTTPSessionManager initWithBaseURL:[NSURL URLWithString:baseURL];
    AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
    policy.allowInvalidCertificates = YES;
    apiManager.securityPolicy = policy;
    

提交回复
热议问题