【问题标题】:Charles proxy SSL issue查尔斯代理 SSL 问题
【发布时间】:2018-08-14 02:36:03
【问题描述】:

遇到此错误 SSL Proxying not enabled for this host: enable in Proxy Settings, SSL locations when trying to hit HTTPS request.请建议我该怎么做。我是第一次运行,因此不胜感激。

【问题讨论】:

标签: ios ssl https ssl-certificate charles-proxy


【解决方案1】:

您需要右键单击该请求,然后选择启用 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);
    }
}

如果你不这样做,请求只是因为握手失败而失败。您可能还需要安装 Charles 根 SSL 证书。从顶部菜单:帮助 -> SSL 代理。

【讨论】:

  • 我已经使用 Charles 多年,从未注意到 启用 SSL 代理 命令 — 很棒的提示!
猜你喜欢
  • 2018-03-31
  • 1970-01-01
  • 1970-01-01
  • 2018-11-11
  • 1970-01-01
  • 2016-01-24
  • 2023-04-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多