title: Issue about creating HTTPS Server and install local IPA on iOS 10
body: <p>I'm developing an App which need to connect a SSL-VPN tunnel and fetch an enterprise IPA and install it on iOS device.</p>
  
  <p>My App can call the SSL-VPN sdk and download the IPA file from the vpn-tunnel, but the iOS/AppStore installation-module cannot, so there is no way to install the plist and IPA file directly. So I got some open-source code to create a local https server (use my self-signed CA&amp;SSL certificates), download the goal IPA and plist files previusly, then changed the URL contents of the plist to local path:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;items&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;assets&lt;/key&gt;
              &lt;array&gt;
                  &lt;dict&gt;
                      &lt;key&gt;kind&lt;/key&gt;
                      &lt;string&gt;software-package&lt;/string&gt;
                      &lt;key&gt;url&lt;/key&gt;
                      &lt;string&gt;https://localhost:9999/XXX.ipa&lt;/string&gt;
                  &lt;/dict&gt;
                  &lt;dict&gt;
                      &lt;key&gt;kind&lt;/key&gt;
                      &lt;string&gt;full-size-image&lt;/string&gt;
                      &lt;key&gt;needs-shine&lt;/key&gt;
                      &lt;false/&gt;
                      &lt;key&gt;url&lt;/key&gt;
                      &lt;string&gt;https://localhost:9999/logo.png&lt;/string&gt;
                  &lt;/dict&gt;
                  &lt;dict&gt;
                      &lt;key&gt;kind&lt;/key&gt;
                      &lt;string&gt;display-image&lt;/string&gt;
                      &lt;key&gt;needs-shine&lt;/key&gt;
                      &lt;false/&gt;
                      &lt;key&gt;url&lt;/key&gt;
                      &lt;string&gt;https://localhost:9999/logo.png&lt;/string&gt;
                  &lt;/dict&gt;
              &lt;/array&gt;
              &lt;key&gt;metadata&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;bundle-identifier&lt;/key&gt;
                  &lt;string&gt;com.XXX.XXX&lt;/string&gt;
                  &lt;key&gt;kind&lt;/key&gt;
                  &lt;string&gt;software&lt;/string&gt;
                  &lt;key&gt;title&lt;/key&gt;
                  &lt;string&gt;XXX&lt;/string&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt; 
  </code></pre>
  
  <p>Also I placed a index.html in my local web folder:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;iPhone HTTPS Server Example&lt;/title&gt;
  &lt;/head&gt;
  &lt;body bgcolor="#FFFFFF"&gt;
  &lt;h1&gt;Welcome to HTTPServer!&lt;/h1&gt;
  
  
  &lt;a href="itms-services://?action=download-manifest&amp;url=https://localhost:9999/XXX.plist"&gt;Install App&lt;/a&gt;&lt;br/&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>After that I launched my App on my iOS device, use webview/safari to show index.html, (first of all: import my CA certificate and trust it), click the link and installed my local IPA app. <strong>Everything run perfectly on iOS 8 and iOS 9.</strong></p>
  
  <p>After the iOS 10 released, the issue came also.
  On iOS 10, my App and the HTTPS Server can run correctly, but when I click the Install link, system show error popup: Cannot connect to localhost.</p>
  
  <p>So I generated some SSL certificates (bound to the specified IP address) and did these test then:</p>
  
  <p><strong>Test 1.</strong> Launch my App on iOS 9 device, use the iOS 10 device to access the web page from iOS 9, click the link and install IPA on iOS 10, successfuly!</p>
  
  <p><strong>Test 2.</strong> Launch my App on iOS 10 device, use the iOS 9 device to access the web page from iOS 10, click the link and install IPA on iOS 9, successfuly!</p>
  
  <p><strong>Test 3.</strong> Launch my App on iOS 9 device, access the web page from local, click the link and install IPA locally, successfuly!</p>
  
  <p><strong>Test 4.</strong> Launch my App on iOS 10 device, access the web page from local, click the link and install IPA locally, FAILED! FAILED! FAILED!</p>
  
  <p>What the hell is the reason, God Save Me!!!!!!!</p>
  
  <p>I'm almost crazy, could anyone please help me, thanks a lot!</p>