NSMutableURLRequest 检查 Https SSL 证书验证
我正在尝试在我的应用程序中使用 ssl,显然我没有注意到 NSURLConnection 在使用带有自签名证书的 https 时抛出任何异常。我很好奇不验证证书的可能性是什么?我正在嗅探数据包,它使用 https 端口来绕过事务,但不会以某种方式遇到异常。
谢谢。
I am trying to utilize ssl for my application and apparently I don't notice that NSURLConnection is throwing any exception when using https with self signed cert. I am curious what might be the possibilities for not validating cert? I am sniffing the packets and it is using https port to bypass the transaction, but don't encounter the exception somehow.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果证书是自签名的,那么它实际上不是受信任的 https 证书。如果您想绕过它,请使用以下代码片段:
如何使用 NSURLConnection 连接 SSL 以获得不受信任的证书?
If the cert is self-signed then it isn't actually a trusted https cert. If you want to bypass it use the code snippet at:
How to use NSURLConnection to connect with SSL for an untrusted cert?