HTTPS on iPhone

2019-04-15 06:33发布

问题:

I need to be able to use https to connect to a server and I'm wondering if there's recommended way of doing this on the iPhone that's NOT: - an undocumented api call - does not require manually storing certificates in the app bundle

Thanks all.

回答1:

NSURLRequest and NSURLConnection are what you're looking for. Start with the docs for those.



回答2:

What's the problem you have with using https? The URL Loading System (i.e. NSURLConnection) and WebKit both support it out-of-the-box. The only issue I know of is with using untrusted certificates, and the only solution I know of to that is (unfortunately) to use a private API call. But you shouldn't be shipping an app that relies on communicating with a server that uses untrusted certificates anyway.