查尔斯代理 SSL 问题



面对此错误 未为此主机启用 SSL 代理:尝试命中 HTTPS 请求时,在代理设置、SSL 位置中启用。请告诉我该怎么做。我是第一次运行这个,所以任何帮助将不胜感激。

您需要右键单击该请求,然后选择启用 SSL 代理。

此外,如果您正在使用 NSURLSession 和 HTTPS,则需要实现以下内容:

-(void) URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler {
    if([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]){
        NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
        completionHandler(NSURLSessionAuthChallengeUseCredential,credential);
    }
}

如果不这样做,请求就失败并导致握手中断。您可能还需要安装查尔斯根SSL证书。从顶部菜单:帮助 -> SSL 代理。

最新更新