NSMutableURLRequest检查Https SSL证书验证

时间:2022-09-06 21:20:09

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.

我正在尝试将ssl用于我的应用程序,显然我没有注意到当使用带有自签名证书的https时,NSURLConnection会抛出任何异常。我很好奇不能验证证书的可能性是什么?我正在嗅探数据包,并使用https端口绕过事务,但不会以某种方式遇到异常。

Thanks.

1 个解决方案

#1


1  

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:

如果证书是自签名的,那么它实际上不是受信任的https证书。如果您想绕过它,请使用以下代码段:

How to use NSURLConnection to connect with SSL for an untrusted cert?

如何使用NSURLConnection连接SSL以获取不受信任的证书?

#1


1  

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:

如果证书是自签名的,那么它实际上不是受信任的https证书。如果您想绕过它,请使用以下代码段:

How to use NSURLConnection to connect with SSL for an untrusted cert?

如何使用NSURLConnection连接SSL以获取不受信任的证书?