---
title: "#141: App Transport Security Basics 🔐"
url: https://littlebitesofcocoa.com/141-app-transport-security-basics
author: Jake Marsh
published: 2015-12-07
topics: ["Security","Networking"]
description: "App Transport Security was introduced with iOS 9 and OS X 10.11. It aims to make the network calls we make from our apps more secure by enabling many best..."
---

# #141: App Transport Security Basics 🔐

By Jake Marsh, December 7, 2015. HTML: https://littlebitesofcocoa.com/141-app-transport-security-basics

_App Transport Security_ was introduced with **iOS 9** and **OS X 10.11**. It aims to make the network calls we make from our apps more secure by enabling many best practices like **TLS 1.2** and **forward**<i> secrecy</i> by default. Today we'll take a closer look, and learn how to disable it if needed.

_App Transport Security_ makes support for [Transport Layer Security 1.2](https://en.wikipedia.org/wiki/Transport_Layer_Security) and [forward secrecy](https://en.wikipedia.org/wiki/Forward_secrecy) <i>mandatory</i>. It also <i>requires</i> certificates to have a **SHA256+**, **ECC256+**, or **RSA2048+** signature. Don't worry if that sounds like gibberish, the idea here is that Apple will maintain _ATS_ on an ongoing basis, keeping it always up-to-date with the latest security best practices and standards.

Apple is enforcing _ATS_ by automatically "opting-in"  the **NSURLConnection**, **NSURLSession**, and **CFURL** APIs (plus anything  built on top of them).

**This means these APIs will throw errors, and the connections will fail** if we try to use them with a connection that doesn't meet all the requirements.

Unfortunately, not all connections we need to make in our apps will support _ATS_. In these cases, we'll need to tell the system to exempt these connections, and allow them to be made insecurely. We'll do this by adding some keys to our app's **Info.plist**:

We'll start by opening our **Project's** settings, then heading to the **Info** tab.

Then, we'll right click the list of keys, and choose **Add Row**. We'll use the inline **plus buttons** to continue adding and configuring rows until we end up with this:

<img src='https://media.littlebitesofcocoa.com/bite-assets/141-app-transport-security-basics-exemptions.png' style='max-width: 600px;' />

There's also keys for allowing for lower minimum **TLS** versions, as well as not requiring **forward secrecy**. 

It's encouraging to see Apple putting such an emphasis on securing our apps. [App Transport Security](https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-SW14) is big step forward in making all of our apps safer for us and our users.
