【发布时间】:2023-03-23 09:25:01
【问题描述】:
我收到这个错误
The certificate for this server is invalid. You might be connecting to a server
that is pretending to be "server addres goes here" which could put your
confidential information at risk."
我正在使用这种方法:
[NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
我该如何解决这个问题?
我试过这段代码:
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request
delegate:self];
但后来我在 didReceiveResponse 方法中得到 EXC_BAD_ACCESS。
【问题讨论】:
-
“使用 NSURLConnection 忽略证书错误” - 最好解决问题而不是忽略错误。如果您不打算正确使用 PKI 和 SSL,那为什么还要使用它呢?
标签: cocoa-touch cocoa nsurlconnection