Ich verwende ASIHTTPRequest v1.8.1, um eine HTTPS-Anfrage zu stellen. Das Problem ist, dass es nicht auf iOS 5.0 & 5.0.1 funktioniert, während auf 5.1 & 5.1.1 es gut funktioniert. Der Code ist recht einfach:
__block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:RemoteNotiURL]];
[request setPostValue:@"i" forKey:@"plat"];
[request setPostValue:token forKey:@"token"];
[request setValidatesSecureCertificate:NO];
[request setCompletionBlock:^{
NSLog(@"done");
}];
[request setFailedBlock:^{
NSLog(@"error = %@", [request error]);
}];
[request startAsynchronous];
RemoteNotiURL
ist eine URL wie https://xxx.example.com
Der Fehler ist:
error = 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=0x18460b0 {NSUnderlyingError=0x1853ab0 "The operation couldn’t be completed. (OSStatus error -9800.)", NSLocalizedDescription=A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)}
Was kann ich dagegen tun?