319

We distribute apps via an Enterprise account, using an itms-services:// URL. This has always worked fine, but after installing the iOS 7.1 beta on our iPad it refuses to install. Instead we just get the generic Cannot connect to example.com message that iOS unhelpfully displays when there is any sort of problem downloading the app.

I've been unable to find anything here on SO, on Google or in the 7.1 release notes to suggest what could be causing the problem.

3
  • 1
    Does this also include the build server that is part of Mavericks Server?
    – Dan
    Commented Jan 24, 2014 at 15:33
  • This was broken for us on our OS X Server as well.
    – toofah
    Commented Jan 29, 2014 at 4:02
  • maybe this will help teratotech.com/blog/…
    – HelmiB
    Commented Jan 20, 2015 at 2:55

16 Answers 16

330

I found the issue by connecting the iPad to the computer and viewing the console through the XCode Organizer while trying to install the app. The error turns out to be:

Could not load non-https manifest URL: http://example.com/manifest.plist

Turns out that in iOS 7.1, the URL for the manifest.plist file has to be HTTPS, where we were using HTTP. Changing the URL to HTTPS resolved the problem.

I.e.

itms-services://?action=download-manifest&url=http://example.com/manifest.plist

becomes

itms-services://?action=download-manifest&url=https://example.com/manifest.plist

I would assume you have to have a valid SSL certificate for the domain in question. We already did but I'd imagine you'll have issues without it.

16
  • 5
    You can create self-signed SSL certificate for your website, don't forget to create a profile using iPhone Configuration Utility to make the certificate trusted on your device.
    – Niralp
    Commented Dec 15, 2013 at 21:04
  • 1
    @SantaClaus Have you checked that the link with "itms-services://" contains https:// and not http:// ? In addition, check that you plist contains IPA Url with HTTPS as well.
    – Niralp
    Commented Dec 21, 2013 at 20:28
  • 3
    I am having the same trouble as @Niralp. I setup our apache server with self-signed SSL certificate. The server seems to be working with SSL just fine, but the OTA links still don't work and give the error reported above. I installed the certificate on the iOS device, but that did not make a difference either. Any thoughts?
    – toofah
    Commented Jan 29, 2014 at 4:06
  • 5
    I created my own Certificate Authority and signed the web server ssl certificate with it. Via Apple Configurator you can create a profile that marks this CA as trusted. After that the installation works as expected.
    – Monobono
    Commented Mar 13, 2014 at 13:38
  • 1
    It is worth noting that the URLs contained within the manifest.plist DO NOT need to be HTTPS. Only the ITMS URL needs to be HTTPS Commented Apr 3, 2014 at 17:30
235
+50

ingconti is right.

  1. Upload your app.plist to dropbox.
  2. Get shared link of app.plist, like https://www.dropbox.com/s/qgknrfngaxazm38/app.plist
  3. replace www.dropbox.com with dl.dropboxusercontent.com in the link, like https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist
  4. Remove any parameters on the dropbox shareable link such as "?dl=0t" (as per Carlos Aguirre Tradeco at Enterprise app deployment doesn't work on iOS 7.1 and my own experience).
  5. Create a download.html file with a link formatted as <a href="itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist">INSTALL!!</a>
  6. Upload your download.html to dropbox
  7. Again, get a shared link of download.html, like https://www.dropbox.com/s/gnoctp7n9g0l3hx/download.html, and remove any parameters.
  8. Replace www.dropbox.com with dl.dropboxusercontent.com in the second link as well, like https://dl.dropboxusercontent.com/s/gnoctp7n9g0l3hx/download.html

Now, visit https://dl.dropboxusercontent.com/s/gnoctp7n9g0l3hx/download.html in your device, you can install the app like before.

WHAT A WONDERFUL WORLD!

22
  • Such a shame that you have to do this and by the way, doesn't that completely bypass Apple's rationale for requiring SSL in the first place? Commented Mar 13, 2014 at 19:11
  • 13
    thanks... am a big fan of Apple, but starting to hate it nowadays.. coz of these stupid things that ruins my time...
    – Karthik
    Commented Mar 16, 2014 at 23:19
  • 1
    I did all of the steps above. I'm facing with the same issue like DanM. The download starts but after a few seconds, "... could not be downloaded at this time" alert comes.
    – alper_k
    Commented Mar 18, 2014 at 14:18
  • 1
    I'm getting this error: "Cannot connecto to dl.dropboxusercontent.com" where trying to install <a href="itms-services://?action=download-manifest&amp;url=dl.dropboxusercontent.com/s/56ny312cwdacho7/xxxxx.plist> with https
    – nano
    Commented Mar 26, 2014 at 10:47
  • 2
    I Got it .Previously i saved files in my private folder ,again i changed those to public folder .Do not forget to put files in public folder .Cheers Oldman Commented Jan 22, 2015 at 9:40
72

Further to the Mark Parnell's answer, a quick-and-dirty way of getting around this is to put the manifest plist into Dropbox, and then using the Dropbox web interface to get a direct https link to it ('Share link' -> 'Get link' -> 'Download').

The actual ipa can remain wherever you always served it from. You'll need to URL-encode the plist's URL before inserting it into the itms-servivces URL's query (although just replacing any &s with %3D might work).

One downside is that the install dialog will now read "dl.dropbox.com wants to install [whatever]".

1
  • 1
    I made a tool to help with this: otter-ota.herokuapp.com. It will automatically adjust your dropbox share urls, generate a plist (since xcode doesn't do this anymore?) and create the required itms link and html. It can also host a landing page if you want.
    – Soup
    Commented Apr 9, 2015 at 15:28
35

It is true, going forward you are expected to do all OTA deployments over https going forward with iOS7.1. Shame on Apple for not documenting this.

For those of you that are looking for a better in-house solution than relying on dropbox or having to fork out cash for a certificate you can have a solution if you follow the steps outlined in tip #5 here: http://blog.httpwatch.com/2013/12/12/five-tips-for-using-self-signed-ssl-certificates-with-ios/

The gist of it is this:

  • Create your own CA Authority certificate that you can install on the device that is fully trusted (I installed by simply emailing it)
  • Create the key/cer pair against the root certificate and install it on your server
  • Make sure your webserver utilizes the key/cer pair that matches the CA Authority root certificate
  • At this point you should be able to install your apps as usual over https
  • All of this can be accomplished on OSX using openssl which is already installed by default

This is not the same as just doing a self-signed certificate, in this solution you are also acting as your own private Certificate Authority. If your root certificate that is installed on your Apple device is not marked as Trusted (green) then something is wrong. Do it over.

This absolutely works.

Update: 3/13/2014 - I have provided a small command line utility that simplifies this entire process. You can get it at: https://github.com/deckarep/EasyCert/releases

5
  • I just spent an hour figuring this bit out. Using a 8192 bit key for your CA cert will fail. iOS will import your cert but won't trust it for what ever reason. A 4096 bit CA key does work.
    – EmeraldD.
    Commented Mar 13, 2014 at 21:47
  • 1
    @EmeraldD. There is no where in the code: github.com/deckarep/EasyCert/blob/master/EasyCert.go that uses a 8192 bit key. In fact, the tool uses keys that are 2048 just like the article demonstrates. Sorry you lost time. Commented Mar 13, 2014 at 22:42
  • @ZhaoXiang I can look into adding this. Would you mind filing an issue here: github.com/deckarep/easycert/issues and if possible posting all the commands you used to convert all the files as needed. Commented Apr 11, 2014 at 16:31
  • @nath, I've checked your links and I think they are adding the cers using MMC instead of IIS. I'm using IIS 7 and I added the cers from the "Server Certificates" section of IIS, by using "Import" from the "Action" panel.
    – Zhao Xiang
    Commented Jun 6, 2014 at 2:02
  • 1
    This is the actual answer guys, +1 :)) Commented Jul 2, 2015 at 10:22
33

I had the same problem and although I was already using an SSL server, simply changing the links to https wasn't working as there was an underlying problem.

enter image description here Click here for image

That highlighted bit told me that we should be given the option to trust the certificate, but since this is the app store, working through Safari that recovery suggestion just isn't presented.


I wasn't happy with the existing solutions because:

  • Some options require dependance on a third party (Dropbox)
  • We weren't willing to pay for an SSL certificate
    • Free SSL certificates are only a temporary solution.

I finally found a solution by creating a Self Signed Root Certificate Authority and generating our server's SSL certificate using this.

I used Keychain Access and OSX Server, but there are other valid solutions to each step


Creating a Certificate Authority

From what I gather, certificate authorities are used to verify that certificates are genuine. Since we're about to create one ourselves, it's not exactly secure, but it means that you can trust all certificates from a given authority. A list of these authorities is usually included by default in your browsers as these are actually trusted. (GeoTrust Global CA, Verisign etc)

  • Open Keychain and use the certificate assistant to create an authority

enter image description here

  • Fill in your Certificate Authority Information

enter image description here

  • I don't know if it's necessary, but I made the authority trusted.

enter image description here


Generating a Certificate Signing Request

In our case, certificate signing requests are generated by the server admin. Simply it's a file that asks "Can I have a certificate with this information for my site please".

  • Next you'll have to create your Certificate Signing Request (I used OSX Server's Certificates manager for this bit

enter image description here

  • Fill in your certificate information (Must contain only ascii chars!, thanks @Jasper Blues)

enter image description here

  • Save the generate CSR somewhere

enter image description here


Creating the Certificate

Acting as the certificate authority again, it's up to you to decide if the person who sent you the CSR is genuine and they're not pretending to be somebody else. Real authorities have their own ways of doing this, but since you are hopefully quite sure that you are you, your verification should be quite certain :)

  • Go back to Keychain Access and open the "Create A Certificate.." option as shown

enter image description here

  • Drag in your saved CSR to the box indicated

enter image description here

  • Click the "Let me override defaults for this request button"

enter image description here

  • I like to increase the validity period.

enter image description here

  • For some reason, we have to fill in some information again

enter image description here

  • Click continue on this screen

enter image description here

  • MAKE SURE YOU CLICK SSL SERVER AUTHENTICATION, this one caused me some headaches.

enter image description here

  • You can click continue through the rest of the options.

  • The Mail app will open giving you the chance to send the certificate. Instead of emailing, right click it and save it.

enter image description here


Installing the Certificate

We now need to set up the server to use the certificate we just created for it's SSL traffic.

  • If the device your working on is your server, you might find the certificate is already installed.

enter image description here

  • If not though, double click the Pending certificate and drag the PEM file that we just saved from the email into the space indicated. (Alternatively, you can export your PEM from keychain if you didn't save it.)

enter image description here

  • Update your server to use this new certificate. If you find that the new certificate won't "stick" and keeps reverting, go back to the bit in BOLD ITALIC CAPS

enter image description here


Setting Up Devices

Each device you need to install apps on will need to have a copy of this certificate authority so that they know they can trust SSL certificates from that authority

  • Go back to Keychain Access and export your certificate authority as a .cer

enter image description here

  • I then put this file on my server with my OTA apps, users can click this link and download the authority certificate. Emailing the certificate directly to users is also a valid option.

enter image description here

  • Install the certificate on your device.

enter image description here


Test

  • Make sure your plist links are https

    • Try and install an app! It should now work. The certificate authority is trusted and the SSL certificate came from that authority.
10
  • I did not quite understand the last part of your answer, does this mean I have to put the .cer file on my server, user should download the .cer via HTTP before he/she can install the ipa via HTTPS, is my understanding correct?
    – Zhao Xiang
    Commented Apr 1, 2014 at 1:23
  • Note that the .cer doesn't have to be over HTTP since Safari will present the "Would you like to trust this certificate" interface that the app store neglects. Commented Apr 1, 2014 at 7:26
  • 1
    I have completely automated this process with an easy to use command-line tool that only requires two parameters. See my answer regarding: github.com/deckarep/EasyCert/releases Commented Apr 3, 2014 at 16:11
  • I'm using IIS on Windows Server, I've generated a .cer file and put it on my iPhone, but it still does not work, didn't know why. I think I'd rather spend some money on the certification now.
    – Zhao Xiang
    Commented Apr 10, 2014 at 3:36
  • 1
    Also note that the certificate which must be installed on the device is the Certificate Authority cert and not the self signed SSL cert as I mistakenly installed initially
    – NSTJ
    Commented Jul 22, 2014 at 1:21
6

I can confirm it works, But You have to put html AND plist on dropbox. It works also for non-enterprise OTA, i.e. You want to share app with your dev. team.

I did:

a) on my site I made a page with this link:

.. href="https://dl.dropboxusercontent.com/u//(your DB id)/ipa.html">MyApp

b) on DropBox I wrote another HTML page:

.. https://dl.dropboxusercontent.com/u/(your DB id)/MyApp.plist"> Tap to Install MyApp

c) moved plist on DropBox but leaving it to POINT to my old server (no https)

2
  • 7
    I did not need to put the html and it seems to work just fine. Just the plist was enough.
    – Ben G
    Commented Mar 12, 2014 at 17:50
  • which plist is this btw? Is it the app.plist or the one generated when building IPA files? Commented Nov 22, 2018 at 10:06
3

Open up terminal and run the command: curl -i https:// (.ipa file path not plist)

This will tell you whether or not the installer can see the IPA file. If you run the curl command with the '-i' you'll see the full response and it's probably not the IPA file. This is the response the installer sees, so if it's not returning HTTP 200 and an IPA you'll need to return it on your end.

The ITMS installer doesn't save any context from Safari. If you authenticated into a secure portal in Safari, the authentication cookies aren't pass to the the installer. i.e. The installer needs to be able to see the app without authentication and this could be the reason you are getting 'Cannot connect to server'.

1
  • you are asking to run the command from terminal application in iPhone or in MACBook? It seems I am also facing the same issue.
    – user867662
    Commented Jun 27, 2016 at 22:33
2

I had same trouble and did as mentioned above.

  • Put the plist in dropbox.
  • Over the download file button, below an image of the document with mouse right button select the copy link action. This link is already something like https://dl.dropboxusercontent.com/s/xyz123/app.plist?stuff=stuff with many params.
  • Remove the parameters (kept only address between https and .plist)
  • Browse for url encode online, selected one of those links, copy, paste, execute, then the resulting text copied and pasted into the html where I have the itms-services link. By the way I have this html in two different locations, one of those is where the ipa is located.
  • Make sure the plist includes absolute references to the ipa file.

Both pages worked successfully for installing the app in iphones with ios 7.1

But, now iphones with ios 7.0x can't install the app.

I created a new question: upgraded adhoc app deployment doesnt work on ios previous to 7.1

Both issues are tightly related, and also bonded by the lack of official references.

2

Some nice guy handled the issue by using the Class 1 StartSSL certificate and shared Apache config that adds certificate support (will work with any certificate) and code for changing links in existing *.plist files automatically. Too long to copy, so here is the link: http://cases.azoft.com/how-to-fix-certificate-is-not-valid-error-on-ios-7/

2

If you happen to have AWS S3 that works like a charm also. Well. Relatively speaking :-)

Create a bucket for your ad hocs in AWS, add an index file (it can just be a blank index.html file) then using a client that can connect to S3 like CyberDuck or Coda (I used Coda - where you'd select Add Site to get a connection window) then set the connections like the attached:

Then build your enterprise ad hoc in XCode and make sure you use https://s3.amazonaws.com/your-bucket-name/your-ad-hoc-folder/your-app.ipa as the Application URL, and upload it to your new S3 bucket directory.

Your itms link should match, i.e. itms-services://?action=download-manifest&url=https://s3.amazonaws.com/your-bucket-name/your-ad-hoc-folder/your-app.plist

And voilá.

This is only for generic AWS URLs - I haven't tried with custom URLs on AWS so you might have to do a few things differently.

I was determined to try to make James Webster's solution above work, but I couldn't get it to work with Plesk.

1

As an alternative to using Dropbox for enterprise distribution you can use TestFlight for the distribution of enterprise signed apps.

https://www.testflightapp.com/

This is a fantastic service for the hosting and distribution of both ad-hoc development builds AND enterprise builds.

2
1

Further the previous answers about Dropbox, I implemented the following files tree such as only the PLIST file has to be uploaded to Dropbox:

  1. upload the ipa file to your server in http (no change here)
  2. upload the provisioning (.mobileprovision) file to your server in http (no change here)
  3. upload the plist file to your dropbox (no change to do inside the plist file as the URLs are in absolute)
  4. use the option "Share the link with Dropbox" which copies the link to your clipboard. This link has to be copied into your html file into the itms-servivces URL's query after changing the part www.dropbox.com by dl.dropboxusercontent.com. Note I URL encoded the link as suggested by @Mike but I don't test without to do it. Now the itms-services URL's query should look like this: itms-services://?action=download-manifest&url=https%3A%2F%2Fdl.dropboxusercontent.com%2Fs%2FYourShortDropboxLink.plist

  5. upload the html file to your server in http. Note the html file contains both links to ipa and provisioning files.

  6. access to your html file from your device and now the ipa can be installed by OTA like usually.

From now, only the ipa file has to be changed to provide next app versions by OTA to your beta testers. Until Apple is yet changing the security rules.

I join here after the very simple HTML file I'm using:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>iPhone app for test</title>
</head>
<body>
<h1>iPhone app for test</h1>
<br/>
<ul>
    <li><a href="http://www.yourdomain.com/with/directories/provision/v.last/yourprovision_adhoc.mobileprovision">
            Install Provisioning File</a></li>
    <li><a href="itms-services://?action=download-manifest&url=https%3A%2F%2Fdl.dropboxusercontent.com%2Fs%2FYourShortDropboxLink.plist">
            Install Application</a></li>
</ul>
</body>
</html>
1
0

Our team uses dropbox for ad-hoc distribution which uses https but still our app was failing to install. After much trouble-shooting we realized that the title field is required too. Whenever we sent out a link without this field safari ignored the link and did not prompt the user to install. Sometimes for quick development tests we skipped over the title node in the xml and not populate it. In case this is helpful for anyone having this issue make sure that your .plist contains the following nodes populated:

      ....
     <string>software</string>
    <key>title</key>
     <string>Your App Name</string>
      ...
0

After reading this post I had still a problem with downloading my app. Problem was because of self signed SSL certificate.

I've found a solution for this problem. You need to upload your certificate file with extension '.crt' on the web and type address of it in your mobile safari. System ask you about adding your certificate to the list of trusted certificates. After this operation you will be able to install your ad-hoc app.

0

The universal solution is to connect your device to Mac and to observe what's going on during installation. I got an error:

Could not load download manifest with underlying error: Error Domain=NSURLErrorDomain Code=-1202 "Cannot connect to the Store" UserInfo=0x146635d0 {NSLocalizedDescription=Cannot connect to the Store, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSLocalizedFailureReason=A secure connection could not be established. Please check your Date & Time settings., NSErrorFailingURLStringKey=https://myserver.com/app/manifest.plist, NSUnderlyingError=0x14678880 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “myserver.com” which could put your confidential information at risk.", NSURLErrorFailingURLPeerTrustErrorKey=, NSErrorFailingURLKey=https://myserver.com/app/manifest.plist}

There was even the suggestion in that error to check date settings. For some reason the date was 1 January 1970. Setting correct date solved the problem.

-1

Apter tried to change itms-services://?action=download-manifest&url=http://.... to itms-services://?action=download-manifest&url=https://..... It also cannot worked. The alert is cannot connect to my domain. I find out that also need update the webpage too.

The issue isn’t with the main URL being HTTPS but some of the HTML code in a link within the page. You’ll need your developers to update the webpage. I also noticed there isn’t a valid SSL certificate on your staging domain so you’ll need to get one installed or use Dropbox and here is the link maybe helpful for you

Not the answer you're looking for? Browse other questions tagged or ask your own question.