iOS 企业部署 : Clicking on itms-services link results in "Cannot connect to [domain]" error

标签 ios iphone ssl plist ipa

为了部署企业 iOS 应用程序,我创建了以下链接:

未编码版本(方便阅读):

<a href="itms-services://?action=download-manifest&url=https://example.com/api/distribution/ios?token=abc123">Download</a>

编码版本:

<a href="itms-services://?action=download-manifest&url=https%3A%2F%2Fexample.com%2Fapi%2Fdistribution%2Fios%3Ftoken%3Dabc123">Download</a>

链接已正确编码,如 herehere 所述。

假设用户的 token 有效,.plist 文件将通过 SSL 返回,如 here 所述。 .plist 文件中引用的 .ipa 文件的 URL 是动态生成的。 .plist 文件如下所示:

<plist version="1.0">
<dict>
    <key>items</key>
    <array>
        <dict>
            <key>assets</key>
            <array>
                <dict>
                    <key>kind</key>
                    <string>software-package</string>
                    <key>url</key>
                    <string>TEMP_URL</string>
                </dict>
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>org.cocos2d.ready-ios</string>
                <key>bundle-version</key>
                <string>0.0.1</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>Ready</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

据我所知,我们的 GoDaddy SSL 证书似乎在 trusted list 上。

然而,尽管有上述所有情况,在点击链接并稍等片刻后,我收到以下错误:

Cannot connect to [domain]

这是点击链接后的 iPhone 控制台输出:

Aug 29 07:30:56 My-iPhone wifid[15] <Notice>: WiFi:[431015456.799163]: Client itunesstored set type to background application
Aug 29 07:30:56 My-iPhone wifid[15] <Notice>: WiFi:[431015456.804319]: BG Application: Not Present, BG Daemon: Present. Daemons: apsd networkd itunesstored 
Aug 29 07:30:56 My-iPhone wifid[15] <Notice>: WiFi:[431015456.806066]: Already connected to [Company Name].
Aug 29 07:30:58 My-iPhone itunesstored[100] <Warning>: Could not load download manifest with underlying error: Error Domain=SSErrorDomain Code=2 "Cannot connect to iTunes Store" UserInfo=0x15788270 {NSLocalizedDescription=Cannot connect to iTunes Store}
Aug 29 07:31:03 My-iPhone wifid[15] <Notice>: WiFi:[431015463.925398]: Client itunesstored set type to normal application
Aug 29 07:31:03 My-iPhone wifid[15] <Notice>: WiFi:[431015463.928745]: BG Application: Not Present, BG Daemon: Present. Daemons: apsd networkd 

有什么想法吗?

最佳答案

我遇到了这个问题,这里或其他答案中记录的解决方案都不适合我。使用正确的 SSL 证书,可以在目标设备上毫无问题地在 safari 中加载 plist。但是,尝试使用“itms-services://...”链接进行安装总是会失败并出现“无法连接到 [domain]”错误。

问题是 中间 SSL 证书没有在网络服务器上配置。 Web 浏览器对此没有问题,SSL 有效,但是将设备连接到 Mac,并通过 XCode 中的设备面板查看日志显示以下错误:

iPhone itunesstored[83] <Warning>: Could not load download manifest with underlying error: Error Domain=NSURLErrorDomain Code=-1202 "Cannot connect to the Store".... "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “[mydomain]”, which could put your confidential information at risk."

在 Apache 上安装中间 SSL 证书解决了这个问题。

关于iOS 企业部署 : Clicking on itms-services link results in "Cannot connect to [domain]" error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25562693/

相关文章:

ios - 获取事件的 MSConversation 以将消息发送到

iphone:NSMutableArray 和 NSMutableDictionary 中的问题

java - 我该如何解决 [收到致命警报 : bad_certificate]?

java - 如何解决 CertPathValidatorException

ios - 通过 IOS 应用程序中的 webview Controller 付款

php - Node 使用公共(public)证书加密

iOS - 如何删除以前添加的 UIView 子层

ios - 为什么在 iOS 中会发生与 dyld_stub_binder 相关的崩溃?

iOS:如何关闭显示的 Leadbolt 广告的添加事件?

iphone - 应用程序加载器 : No eligible applications were found