I'm trying to download a JSON object from a page hosted on a web server, using the method
[NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://<url>"]]
but it doesn't work. The same call with the same address with http://
instead of https://
works. The server has a self-signed certificate, and it's not trusted by iOS (by default).
What can I do to make it trustable by my app?
Don't use +dataWithContentsOfURL:
for this. Use NSURLConnection
directly, which gives you delegate methods to properly control authentication.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With