我geting以下錯誤: 錯誤域= NSURLErrorDomain代碼= -1202「此服務器的證書無效。您可能會連接到假裝爲」API .linkedin.com「,這可能會使您的機密信息處於危險之中。」 UserInfo = 0x1c53e630錯誤域= NSURLErrorDomain代碼= -1202 iPhone
這在模擬器上正常工作,但在上面提到的錯誤設備上。
請幫助糾正它。
我geting以下錯誤: 錯誤域= NSURLErrorDomain代碼= -1202「此服務器的證書無效。您可能會連接到假裝爲」API .linkedin.com「,這可能會使您的機密信息處於危險之中。」 UserInfo = 0x1c53e630錯誤域= NSURLErrorDomain代碼= -1202 iPhone
這在模擬器上正常工作,但在上面提到的錯誤設備上。
請幫助糾正它。
我通過中迷失了我整整一天了吧,這是需要改變的日期和時間,我的設備設置,NAD自動設置ON爲當前時區。
試試這個代碼:
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {
return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
}
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
if ([trustedHosts containsObject:challenge.protectionSpace.host])
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
[challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
}
希望它有用
我已經試過了,這是拋出相同的錯誤,因爲我提到的問題,它在模擬器上工作正常,這個錯誤只會殺死我的設備。 –
通過解釋解決方案將解決什麼問題來改進此答案,或許是爲了便於閱讀而設計的格式。 –
我通過失去了我的整個一天,它是我的設備設置,需要更改日期和時間,nad設置爲當前時區自動打開。 –
有一些努力找到這個在谷歌的努力看看http://stackoverflow.com/questions/3916574/i-want-to-ignore-certificate-verification-where-and-how-to-do -it-with-xmlrpc-我們和http://stackoverflow.com/questions/933331/how-to-use-nsurlconnection-to-connect-with-ssl-for-an-untrusted-cert –
我試過上面的鏈接,但不值得我, –
我通過損失了我的整個一天,它是我的設備設置,需要更改日期和時間,並將其自動設置爲當前時區ON。 –