The certificate for this server is invalid error when startForUploadPhoto uses facebook sdk
My code is like:
[FBRequestConnection startForUploadPhoto:[UIImage imageNamed:@"1.png"]
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (error) {
NSLog(@"%@",error);
}
}];
Mistake:
Error Domain = com.facebook.sdk Code = 5 "The operation couldn't be completed. (Com.facebook.sdk error 5.)" UserInfo = 0x933e390 {com.facebook.sdk: ErrorInnerErrorKey = Error Domain = NSURLErrorDomain Code = -1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be "graph.facebook.com" which could put your confidential information at risk. " UserInfo = 0x9338700 {NSErrorFailingURLStringKey = https: //graph.facebook.com/me/photos sdk = ios & access_token = BAAEPZAb5iLukBADkyh9M8guUFRJwXuGKI6HnZAZAwMvpQtv3RKsD6M62J4inW1oG8DmY5l81pIz4MhcRHMbLsUAlxEqWq557pYCHXqoF9Gv3FdRTrV9Ai3QuL6zBeM7OoSWvOKlFt1fZAx5h0wkh & migration_bundle = fbsdk% 3A20121003 & format = json,? NSLocalizedRecoverySuggestion = Would you like to connect to the server anyway ?, NSErrorFailingURLKey = https: //graph.facebook.com/me/photos sdk = ios & access_token = BAAEPZAb5iLukBADkyh9M8guUFRJwXuGKI6HnZAZAwMvpQtv3RKsD6M62J4inW1oG8DmY5l81pIz4MhcRHMbLsUAlxEqWq557pYCHXqoF9Gv3FdRTrV9Ai3QuL6zBeM7OoSWvOKlFt1fZAx5h0wkh & migration_bundle = fbsdk% 3A20121003 & format = json,? NSLocalizedDescription = The certificate for this server is invalid.You might be connecting to a server that is pretending to be "graph.facebook.com" which could put your confidential information at risk., NSUnderlyingError = 0xa32e810 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be "graph.facebook.com" which could put your confidential information at risk. ", NSURLErrorFailingURLPeerTrustErrorKey =}, com.facebook.sdk: HTTPStatusCode = 200}
How can I solve it?
+3
source to share
No one has answered this question yet
Check out similar questions: