How to connect to localhost from iPhone on Mac OS


Sarah

I read a lot of questions about it and still have the problem.

When I use localhost and correct the NSAppTransportSecurity optinos from the emulator , everything is correct.

Right now, I'm using my iPhone to debug. Both iPhone and Mac are connected to the same network.

I checked the IP address of my mac

I add it to NSAppTransportSecurity like this:

  <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>10.250.x.x</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
        </dict>
    </dict>

I still get the error:

 App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
error = Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x7f904d300170 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}, NSErrorFailingURLStringKey=http://10.250.x.x:8080/IVRServer/api/registration/register, NSErrorFailingURLKey=http://10.250.x.x:8080/IVRServer/api/registration/register, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.}

Should I add something else to my list?

Please don't consider repeating this question because I already have the correct settings in my plist and it works fine, but just when I change the server to non-localhost it doesn't work

What am I missing?

Mundy

If you just want to bypass this restriction, allow all loads:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

This should work because presumably you are using "localhost", so there shouldn't be any security issues.

Related


How to connect to localhost from iPhone on Mac OS

Sarah I read a lot of questions about it and still have the problem. When I use localhost and correct the NSAppTransportSecurity optinos from the emulator , everything is correct. Right now, I'm using my iPhone to debug. Both iPhone and Mac are connected to th

Connect to VirtualBox localhost from Mac host

Nathan Baker I'm running a .NET server on localhost in a virtual machine VM. I want to access the VM localhost from a browser on a Mac - I'm working on a new javascript client for this project and would like to do this on a Mac. There are many answers for doin

Connect to VirtualBox localhost from Mac host

Nathan Baker I'm running a .NET server on localhost in a virtual machine VM. I want to access the VM localhost from a browser on a Mac - I'm working on a new javascript client for this project and would like to do this on a Mac. There are many answers for doin

How to connect to remote mongo server from Mac OS terminal

jononomo : I want to drop into a mongo shell in a MacBook terminal. However, I'm interested in connecting to a Mongo instance running in the cloud (through the Heroku addon's compose.io instance). I have name, password, host, port and database name in MongoDB

How to connect to remote mongo server from Mac OS terminal

Jononomo I want to drop into a mongo shell in a MacBook terminal. However, I'm interested in connecting to a Mongo instance running in the cloud (through the Heroku addon's compose.io instance). I have name, password, host, port and database name in MongoDB UR

How to connect to remote mongo server from Mac OS terminal

jononomo : I want to drop into a mongo shell in a MacBook terminal. However, I'm interested in connecting to a Mongo instance running in the cloud (through the Heroku addon's compose.io instance). I have name, password, host, port and database name in MongoDB

How to Connect to a Windows PC from a Mac OS X Terminal

Kuomintang I have some Windows PCs on my network. I have Mac OSX. I try to access some Windows PCs in the network to read and write files. In OS X Finder, I see computer_name and can connect as Guest. But in terminal, what should I do? I tried ssh computer_nam

How to Connect to a Windows PC from a Mac OS X Terminal

Kuomintang I have some Windows PCs on my network. I have Mac OSX. I try to access some Windows PCs in the network to read and write files. In OS X Finder, I see computer_name and can connect as Guest. But in terminal, what should I do? I tried ssh computer_nam

How to Connect to a Windows PC from a Mac OS X Terminal

Kuomintang I have some Windows PCs on my network. I have Mac OSX. I try to access some Windows PCs in the network to read and write files. In OS X Finder, I see computer_name and can connect as Guest. But in terminal, what should I do? I tried ssh computer_nam

How to connect to remote mongo server from Mac OS terminal

jononomo : I want to drop into a mongo shell in a MacBook terminal. However, I'm interested in connecting to a Mongo instance running in the cloud (through the Heroku addon's compose.io instance). I have name, password, host, port and database name in MongoDB

How to Connect to a Windows PC from a Mac OS X Terminal

Kuomintang I have some Windows PCs on my network. I have Mac OSX. I try to access some Windows PCs in the network to read and write files. In OS X Finder, I see computer_name and can connect as Guest. But in terminal, what should I do? I tried ssh computer_nam

How to Connect to a Windows PC from a Mac OS X Terminal

Kuomintang I have some Windows PCs on my network. I have Mac OSX. I try to access some Windows PCs in the network to read and write files. In OS X Finder, I see computer_name and can connect as Guest. But in terminal, what should I do? I tried ssh computer_nam

How to connect to MySQL in C++ on Mac OS?

Amateur: Good morning, I am trying to connect to mysql using C++. I am using a Macbook Pro. I use the simple code from the original documentation . When I try to compile the program it fails. main.cpp:15:10: fatal error: 'cppconn/driver.h' file not found #incl

How to connect to MySQL in C++ on Mac OS?

Amateur: Good morning, I am trying to connect to mysql using C++. I am using a Macbook Pro. I use the simple code from the original documentation . When I try to compile the program it fails. main.cpp:15:10: fatal error: 'cppconn/driver.h' file not found #incl

How to connect to MySQL in C++ on Mac OS?

Amateur: Good morning, I am trying to connect to mysql using C++. I am using a Macbook Pro. I use the simple code from the original documentation . When I try to compile the program it fails. main.cpp:15:10: fatal error: 'cppconn/driver.h' file not found #incl

How to connect to localhost from Android Studio emulator

Firanolfind I am trying to test a web application in Android 2.3.3 browser. Connection using http://10.0.2.2 results in "Web page unavailable" . Could n't find anything in the Android Studio documentation . Does anyone have the same problem? How did you solve

How to connect to localhost from Android Studio emulator

Firanolfind I am trying to test a web application in Android 2.3.3 browser. Connection using http://10.0.2.2 results in "Web page unavailable" . Could n't find anything in the Android Studio documentation . Does anyone have the same problem? How did you solve

How to connect to localhost from Android Studio emulator

Firanolfind I am trying to test a web application in Android 2.3.3 browser. Connection using http://10.0.2.2 results in "Web page unavailable" . Could n't find anything in the Android Studio documentation . Does anyone have the same problem? How did you solve

How to connect to database sql file from localhost?

bob max I am trying to connect to my database via php. As mentioned before, I export the php database as a sql file. I tried to connect to it and it showed a message that I was connecting. But I am not. I am running my php in netbeans and the files are at wamp

How to connect to database sql file from localhost?

bob max I am trying to connect to my database via php. I am telling my PHP database as a SQL file. I tried to connect to it and it showed a message that I was connecting. But I am not. I am running my php in netbeans and the files are at wamp > www It shows er

How to connect to localhost from Android Studio emulator

Firanolfind I am trying to test a web application in Android 2.3.3 browser. Connection using http://10.0.2.2 results in "Web page unavailable" . Could n't find anything in the Android Studio documentation . Does anyone have the same problem? How did you solve

How to connect to localhost from Android Studio emulator

Firanolfind I am trying to test a web application in Android 2.3.3 browser. Connection using http://10.0.2.2 results in "Web page unavailable" . Could n't find anything in the Android Studio documentation . Does anyone have the same problem? How did you solve

How to connect to database sql file from localhost?

bob max I am trying to connect to my database via php. As mentioned before, I export the php database as a sql file. I tried to connect to it and it showed a message that I was connecting. But I am not. I am running my php in netbeans and the files are at wamp

How to reach Docker container `localhost` from Mac?

cookies Note that this is different from how to expose a service bound to localhost in a docker container , which can be solved in Docker for Linux in a number of ways, such as by --net hosteven -vbinding my Linux flavor client, etc. My question is specific to

Can't connect to localhost on Mac

Xinyu Huang I'm learning client server and I'm having trouble getting into localhost. I've been looking for an answer for days and I really need your help! After each modification I try ''' sudo appachectl restart" Attempting " localhost ": unable to connect t

Can't connect to localhost on Mac

Xinyu Huang I'm learning client server and I'm having trouble getting into localhost. I've been looking for an answer for days and I really need your help! After each modification I try ''' sudo appachectl restart" Attempting " localhost ": unable to connect t

Can't connect to localhost on Mac

Xinyu Huang I'm learning client server and I'm having trouble getting into localhost. I've been looking for an answer for days and I really need your help! After each modification I try ''' sudo appachectl restart" Attempting " localhost ": unable to connect t