I've created a REST API that goes through HTTPS and I've tested that the API works when I add the cert to the chrome browser, but I'm having difficulty implementing on my iOS app.
The following is the iOS code I used, which works for HTTP, but as I said I'm now using SSL and need to add the cert to my app. I've followed this tutorial which converted my .pem cert to .der extension and I added to the resourced folder. Here is my code when my REST API was utilized over plain HTTP:
NSURL *url = [NSURL URLWithString:@"http://123.456.789.012/iOSappName/RESTservice1"]; //enter URL
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; // make the request
[request setHTTPMethod:@"POST"]; //add the HTTP method to the request
[request setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; //add the content type
[request setHTTPBody:[jsonFile dataUsingEncoding:NSUTF8StringEncoding]]; //add the body and the encoding
NSURLResponse *response; //declare a response
NSError *err; //declare an NSError
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err]; //send the requet and get a response
NSString* responseDataString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
I'm following this tutorial and I'm a bit confused how I can implement the code above with the aforementioned tutorial. Any suggestions, examples, or links that you know of that could assist me?