× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Cordova $http security errors on iOS9

Jessamyn Smith
Oct 23, 2015
<p>If you have an app that makes AJAX calls using $http and the "https" protocol, you may see the following error when you update to iOS 9:</p> <pre><code>Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made.</code></pre> <p>If you are using "http" protocol to make an AJAX call with $http, you may see the following error:</p> <pre><code>Failed to load resource: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.</code></pre> <p>With the advent of iOS 9, making AJAX calls from an Cordova or Ionic app requires disabling app transport security. This can be done by adding the following plugin from the command line:</p> <pre><code class="language-bash">cordova plugin add cordova-plugin-disable-nsapptransportsecurity</code></pre> <p>With this in place, your app should successfully make AJAX calls again.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus