Я пытаюсь выполнить HTTP-вызов на https. Вот мой фрагмент кода.
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]
initWithURL:[NSURL
URLWithString:@"https://testservice.fiamm.com/token"]];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-type"];
NSString *postString = @"username=TestIphone&Password=T3st1ph$n&Grant_type=password";
[request setValue:[NSString stringWithFormat:@"%d", [postString length]] forHTTPHeaderField:@"Content-length"];
[request setHTTPBody:[postString
dataUsingEncoding:NSUTF8StringEncoding]];
// Fetch the JSON response
NSData *urlData;
NSURLResponse *response;
NSError *error;
// Make synchronous request
urlData = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
// Construct a String around the Data from the response
NSString *strFiamm = [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding];
Когда я пытаюсь ввести hurl или postman, я получаю правильный ответ, но когда я пытаюсь ввести свой код, я получаю эту ошибку.
Ошибка HTTP-загрузки NSURLConnection/CFURLConnection (kCFStreamErrorDomainSSL, -9813)
Любая помощь или предложения приветствуются.!