function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jun KeJun Ke 

Trailhead Native iOS Module, Salesforce Error

I followed the tutorial in Getting Started with Native iOS Development.

When I run the app, the simulator popped up:
Salesforce Error
Cannot connect to salesforce: An ssl error has occured and a secure connection to the server cannot be made.
pconpcon
Are you running the simulation on a network where there is a proxy that sits between you and the internet?
Armand Collin 1Armand Collin 1
I'm seeing the same error when creating Hybrid apps.

Found some references suggesting the issue could be work around by setting NSAllowsArbitraryLoads to True in the app .plist file - which seems to be the default already. Still doesn't work for me.

I have no proxy in my environment.
Armand Collin 1Armand Collin 1
I found a work around for my issue, by setting NSExceptionRequiresForwardSecrecy to false for both domains - force.com and salesforce.com - in the app .plist file:

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>salesforce.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>force.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>