Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Enable TLS 1.2, 1.1,1.0, and SSL in iOS app?

My question is related to Apple Transport Security (ATS) and I am too much confused.

I want to support all the protocols (all version of TLS and SSL) in my swift app. If I change NSAllowsArbitraryLoads to false, will app work on all protocols by default? Or do I have to specify domain in configuration and add NSExceptionMinimumTLSVersion?

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
     <key>NSExceptionDomains</key>
<dict>
    <key>your.servers.domain.here</key>
    <dict>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key>NSExceptionRequiresForwardSecrecy</key>
        <false/>
        <key>NSExceptionMinimumTLSVersion</key>
        <string>TLSv1.0</string>
    </dict>
</dict>

And how can I check my app is communicating with server on what protocol?

like image 630
Wajahat Chaudhry Avatar asked May 19 '16 10:05

Wajahat Chaudhry


People also ask

What TLS version does iOS use?

iOS, iPadOS, and macOS support Transport Layer Security (TLS 1.0, TLS 1.1, TLS 1.2, TLS 1.3) and Datagram Transport Layer Security (DTLS). The TLS protocol supports both AES128 and AES256, and prefers cipher suites with forward secrecy.

How do I enable TLS 1.1 and TLS 1.2 on Mac?

Press Ctrl+F12 (or Command+F12 on a Mac), or click the Opera menu and go to Settings→Preferences. Click on the Advanced tab, then Security in the left sidebar, then the Security Protocols button. Make sure that only Enable TLS 1.2 is checked.

How do I enable TLS on my IPAD?

Click on "Preferences" and then click on the "Advanced" icon. Then click on the "Change Settings..." button. Click on the "Advanced" tab in the Internet Properties window and browse through the Settings section to make sure that the TLS checkbox is selected. Check the box if it is not and then click on the "OK" button.


2 Answers

You'll want to read up https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33

In short, you need to specify NSExceptionMinimumTLSVersion to support TLS1.0 and up; 1.2+ is the default.

Why are you trying to support older, less secure protocols anyway?

I don't know how you could check which protocol is being used, but if you can configure a server to only work with, say, TLS 1.0, then your app will only connect with the TLSv1.0 key in place; and that's easy to test.

like image 161
Graham Perks Avatar answered Oct 05 '22 14:10

Graham Perks


Connecting Securely to a URL

Connecting to a URL via TLS is trivial. When you create an NSURLRequest object to provide to the initWithRequest:delegate: method, specify https as the scheme of the URL instead of http. The connection uses TLS automatically with no additional configuration.

https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/SecureNetworking/SecureNetworking.html

like image 35
Nazrul Islam Avatar answered Oct 05 '22 14:10

Nazrul Islam