127.0.0.1 does not work if VPN is broken

Originator:gagan.mazed
Number:rdar://16311713 Date Originated:13-Mar-2014
Status:Open Resolved:
Product:iOS Product Version:7.1
Classification: Reproducible:Everytime
 
Abdullah Al Mazed13-Mar-2014 10:54 AM

Summary:
We have an app that uses Safari to install configuration profile. App uses localhost (127.0.0.1) to provide the configuration file. This works fine in 'normal' situation, with or without internet.

But Safari fails to connect to localhost if the device has VPN connection and that VPN is broken. it says "Safari cannot open the page "http://127.0.0.1:xxxxx/" because your iPad is not connected to the Internet."

Note: Safari can load page from localhost just fine when there is no connectivity on the device otherwise:
 - It works when an Wifi only ipad's wifi is turned off.
 - It works when device is set to airplane mode.

We expected VPN connection will not affect when connecting to 127.0.0.1

Steps to Reproduce:
Required files:
 - The attached config (which will install a VPN config that will fail to connect)
 - iPhoneHttpServer app from the code provided (The code is based on a sample app of https://github.com/robbiehanson/CocoaHTTPServer)

Steps:
  1) Install Sample/iPhoneHTTPServer and launch the app.
  2) Tap 'Launch localhost'. Safari will be automatically launched.
  3) Safari will show a page with text 'Welcome to CocoaHttpServer!'.
  4) Now install the localhosttest.mobileconfig.
  5) Repeat step 2.

Expected Results:
Safari will show a page with text 'Welcome to CocoaHttpServer!'.

Actual Results:
Safari says "Safari cannot open the page "http://127.0.0.1:xxxxx/" because your iPad is not connected to the Internet.".

Version:
iOS 7.1 (11D167) 
iOS 7.0 (11A465)

Notes:
- We are working on an app that will provide VPN configuration easily.
- In combination with another bug we have submitted already (16109161 : iOS IPSec VPN client fails to reconnect after idle time), this bug became a serious problem for us.

Configuration:
iPhone 4S, MD239KS/A,  iOS 7.1 (11D167) 
iPad mini retina, ME276KS/A, iOS 7.1 (11D167)
iPad Retina, MD328KS/A, iOS 7.0 (11A465)

Attachments:
'localhosttest.mobileconfig'  (A config that a VPN setup that will always fail)
and 'TSI-iOS-LocalHost-Via-VPN.zip' were successfully uploaded. (Based on CocoaHTTPServer iPhone sample, only a button added to launch safari to load localhost)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!