My iPhone application was rejected solely for using the (very safe, it seems) private method +setAllowsAnyHTTPSCertificate:forHost:
for NSURLRequest
. Is there a non-private API to emulate this functionality?
views:
1279answers:
4One really stupid workaround is to make your own category method:
@implementation NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
This should get by Apple's private API checks, but it's still the same thing (using a private, undocumented API[1] that is liable to break at any time). Actually, it's worse since it allows everything, not just that host.
[1]: An private API that should be made public, but a private API nevertheless.
Take a look at this link: http://www.abstractec.co.uk/blog/iPhone.php?itemid=70
Might be a better solution for you than just tricking the private API check.
I am not saying about solution but suggestion. Have you thought to use ASIHttpRequest Framework for this? This framework is complete in all aspects. Do check the documentation, may be it can help you too.
Thanks, Madhup
There seems to be a public API for that ;) http://stackoverflow.com/questions/933331/how-to-use-nsurlconnection-to-connect-with-ssl-for-an-untrusted-cert/2033823#2033823