Wie kann ich damit https-Verbindung mit AFNetworking?

Habe ich AFNetworking, aber es ist nicht zu akzeptieren https-urls. Wie bekomme ich AFNEtworking um eine Verbindung über ssl.

Ich habe den folgenden code:

  NSMutableURLRequest *apiRequest =
[self multipartFormRequestWithMethod:@"POST"
                                path: pathstr
                          parameters: params
           constructingBodyWithBlock: ^(id <AFMultipartFormData>formData)
           {
               //TODO: attach file if needed
           }];



AFJSONRequestOperation* operation = [[AFJSONRequestOperation alloc] initWithRequest: apiRequest];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
    //success!
    completionBlock(responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    //failure :(

    NSLog(@"%@", error);
    completionBlock([NSDictionary dictionaryWithObject:[error localizedDescription] forKey:@"error"]);
}];

[operation start];
  • Was der Fehler in deinem log? Auch, ist Ihr server-cert gültig?
InformationsquelleAutor jake | 2013-02-15
Schreibe einen Kommentar