I get the following error. I try to connect to a server via https, I
copyed the certificate so the Xcode project.
Error:
Hit error: Error Domain=NSURLErrorDomain Code=-1012 "The operation
couldn’t be completed. (NSURLErrorDomain error -1012.)"
UserInfo=0x6ba4af0 {NSErrorFailingURLKey=https://localhost/
Immobilien/, NSErrorFailingURLStringKey=https://localhost/Immobilien/}
Thats my Code:
RKObjectManager *objectManager = [RKObjectManager
objectManagerWithBaseURL:@"https://localhost"];
objectManager.objectStore = [RKManagedObjectStore
objectStoreWithStoreFilename:@"ImmobilienRestKitSample.sqlite"];
objectManager.client.disableCertificateValidation = NO;
NSData* certData = [NSData dataWithContentsOfFile:[[NSBundle
mainBundle] pathForResource:@"localhost" ofType:@"cer"]];
if( [certData length] )
{
SecCertificateRef cert = SecCertificateCreateWithData(NULL,
(__bridge CFDataRef) certData);
if( cert != NULL )
{
[objectManager.client addRootCertificate:cert];
NSLog(@"SSL-Certificate: %@",certData);
CFRelease(cert);
}
}
On Nov 22, 2:25 pm, Alexander Buder <buder.alexan...@googlemail.com>
wrote: