trivago / Heimdallr.swift

Easy to use OAuth 2 library for iOS, written in Swift.
Apache License 2.0
639 stars 87 forks source link

Support for SSL connections using self-signed certificates #89

Open pk1 opened 8 years ago

pk1 commented 8 years ago

Hi,

since Apple introduced ATS (App Transport Security) normal HTTP connections are not allowed anymore. Of course you can bypass this as long as you're still in development mode and you don't need to publish your app on the app store. Same applies to connections you need to establish to servers using a self-signed SSL certificate.

The problem now is that as far as I can see Heimdallr is not able to use SSL connections with self-signed certificates on the server-side (at least during development there should be no need to pay money for an official SSL certificate). Is there any change to implement this feature in Heimdallr so connections to servers with a self-signed certificate can be used?

Thanks for all your work so far!!

hffmnn commented 8 years ago

Hi,

I would say you just have implement your own HTTPClient class, conforming to the HeimdallrHTTPClient protocol, give it to Heimdallrs initializer and you should be good to go.

If this does not work (or I missed something) please ping back here. If it works: Please ping back here and feel free to post/gist your solution 😄