views:

655

answers:

2

I have a self signed SSL certificate serving out my test enviroment. I would like to do some testing connecting to the service from my iphone however, the SSL exception is causing an error.

Is there a way to ignore the SSL exception on the iPhone?

Edit:

I should have added a bit more detail, the answers below will work hoever if i can get it to work inside NSXMLParser that would be even better.

A: 

See this article by John Haselden for doing it with CFReadStream.

Peter N Lewis
+2  A: 

If you're only testing, you can use the private setAllowsAnyHTTPSCertificate:forHost: method on NSURLRequest. Otherwise, I'd recommend using the ASIHTTPRequest library which provides a great high-level API to the CFNetwork APIs, including the ability to use self-signed certificates. The method you're looking for is setValidatesSecureCertificate:.

Nathan de Vries
Can that be called for multiple hosts? (Again, it's for quick testing only, and this is for a test-only host where I can't get a proper cert installed.)
Joe D'Andrea