[request setValidatesSecureCertificate:NO]
Since this is getting some upvotes, I'd just like to add that this might not be the best approach for valid SSL certificates. The one I was using was a self-signed certificate, so this was fine.
本文讨论了在使用自签名证书时禁用SSL证书验证的方法。作者提到这种方法可能不适合所有情况,特别是对于有效SSL证书的验证。
[request setValidatesSecureCertificate:NO]
Since this is getting some upvotes, I'd just like to add that this might not be the best approach for valid SSL certificates. The one I was using was a self-signed certificate, so this was fine.

被折叠的 条评论
为什么被折叠?