I am trying to get a self-signed certificate to work with my application.
I am using the ASIHTTPRequest library at the moment like so :
- (IBAction)sendHttpsRequest
{
//Set request address
NSMutableString *databaseURL = [[NSMutableString alloc] initWithString:@"https://142.18.87.46:443"];
//call ASIHTTP delegates (Used to connect to database)
NSURL *url = [NSURL URLWithString:databaseURL];
//This sets up all other request
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setDelegate:self];
[request setValidatesSecureCertificate:YES];
[request startAsynchronous];
}
I have set setValidatesSecureCertificate to YES in the hope that something would happen but obviously nothing has because I'm not sure what I have to do.
This is the error I'm getting in my log
2011-12-06 14:27:33.514 connectionTest[916:207] Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)" UserInfo=0x683a860 {NSUnderlyingError=0x68390d0 "The operation couldn’t be completed. (OSStatus error -9807.)", NSLocalizedDescription=A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)}
Any help would be greatly appreciated.