9

我们有一个配置了 SSL 证书并启用了 Xcode 的 osx 服务器。在将 OSX Server 更新到 3.2.1 和 Xcode 6.0.1 之前一切正常。

我们遇到的问题是,当集成完成后,我们单击设备上的安装按钮,它会尝试下载但静默失败。设备日志打印:

9 月 22 日 13:32:29 somePhone itunesstored[84]:无法加载下载清单并出现基础错误:错误域 = NSURLErrorDomain 代码 = -1001“无法连接到 buildserver.com” UserInfo = 0x14f74dfe0 {NSUnderlyingError = 0x14f6e8330“请求超时.", NSErrorFailingURLStringKey= https://buildserver.com:20343/api/integrations/fc9e3c6ed7d80506e9e8e37b0d06a905/87785234-f589-4230-9c0c-055f656b28a6/install_manifest.plist , NSErrorFailingURLKey= https://buildserver.com /fc9e3c6ed7d80506e9e8e37b0d06a905/87785234-f589-4230-9c0c-055f656b28a6/install_manifest.plist , _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=60, NSLocalizedDescription=无法连接到 buildserver.com}

当我检查端口 20343 时,来自 OSX Server 的有效 ssl 证书被切换为由 Xcode Server Root Certificate Authority 签名的证书,它似乎是自签名的。

在旧版本的 osx 服务器中,端口 20343 不存在,因为 plist 文件与站点的其余部分在同一端口下提供。有关侦听端口 20343 的服务器的信息。

sudo lsof -i | grep "20343"
Password:
node         65          _xcsd   15u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29118          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29120          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29121          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29122          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29123          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29124          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      29125          _xcsd   16u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)
node      32397          _xcsd   17u  IPv4 0x73c2c4b0fa77e271      0t0    TCP *:20343 (LISTEN)

这似乎是 osx 服务器和 xcode 机器人上的错误。有没有人可以解决我们如何在我们的设备上下载 ipa 文件?

4

3 回答 3

4

这里同样的问题。

最初,开箱即用的 Xcode Server 解决方案有效,任何设备都可以安装由 Xcode bot 生成的 .ipa。一两天后它突然坏了,没有设备可以下载了,只是显示:

无法连接到www.example.com

在我的 iPhone 上跟踪日志,我还可以看到该设备正在尝试连接到https://www.example.com:20343/api/integrations。这个 Xcode 网络服务显然使用了一个自签名的Xcode 服务器根授权证书(而不是在 OS X 服务器管理应用程序中选择的证书),并且因为任何需要访问这个网络服务请求的客户端都被错误地签名。

Apple Developer Forums 上的一篇文章将我引导至位于此处的 Xcode Server Apache 配置(感谢Paul Verity):

/Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/httpd_xcs.conf

或在 OS X Server 4.1.5 中:

/Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/httpd_xcs.conf

包含通过常规 Xcode 服务器网站公开 web 服务的部分:

<IfModule mod_proxy.c>
    ProxyPass /xcode/api https://127.0.0.1:20343/api retry=0 timeout=30
    ProxyPassReverse /xcode/api https://127.0.0.1:20343/api
    ProxyPass /xcode/socketio http://127.0.0.1:20300 retry=0 timeout=30
    ProxyPassReverse /xcode/socketio http://127.0.0.1:20300
</IfModule>

有趣的是 /xcode/api/ 请求使用正确的证书签名,因此被任何客户端接受。(您可以通过在服务器的 URL 后添加 /xcode/api/integrations 来访问 Xcode 服务器来测试它。这只是一个 JSON 网络服务。如果您的服务器的证书由有效的授权机构签名,它将被接受而不会出现任何问题。)

这导致了我的两步解决方案(假设您的服务器位于路由器/防火墙后面):

1. 将公共 TCP 端口 20300、20343 重定向到防火墙/路由器中的私有 TCP 端口 443 这样,Web 服务请求被转发到使用设备自动接受的正确证书的 Xcode 服务器。Xcode 也使用端口 20344 和 20345,但将它们留给其他连接。注意:如果您有 OS X 服务器管理 Apple 路由器并在“公共服务”下重新切换 XCode,这些更改可能会被覆盖。

2. 代理 /api 和 /socketio 请求到本地 webservice 服务器不知道 /api 所以将以下行添加到你的 httpd_xcs.conf 中的 mod_proxy.c 部分:

ProxyPass /api https://127.0.0.1:20343/api retry=0 timeout=30
ProxyPassReverse /api https://127.0.0.1:20343/api
ProxyPass /socketio http://127.0.0.1:20300 retry=0 timeout=30
ProxyPassReverse /socketio http://127.0.0.1:20300

最后的想法/笔记:

我不确定我们是否应该将网络服务使用自签名证书视为错误。Apple 提供的配置文件不正确也可能是一个问题。也许在 ProxyPass 行中剥离 /xcode 部分而不是添加它们就足够了。

于 2015-01-27T13:30:17.293 回答
1

在 OS X Server 上安装了 SSL 证书,更新 OS X 后出现此问题。通过在 Server app -> Certificates 中重新添加 p12 证书来修复它,然后重新启动。证书可以从钥匙串应用程序导入。

于 2015-04-16T11:49:58.680 回答
0

我在两个不同的 Xcode Server 安装上遇到了同样的问题。

在第一次安装时,Xcode 服务器位于防火墙/代理后面。所以端口 20343 根本无法到达。我通过代理https://externalname.com:20343https://internal.ip.address.here:20343解决了这个问题

这是我使用的 nginx 配置:

server {
  listen 20343;
  server_name xcode.foo.com;

  access_log /var/log/nginx/xcode.access.log;
  error_log /var/log/nginx/xcode.error.log;

  ssl on;
  ssl_certificate /root/foo_com/foo_com.crt;
  ssl_certificate_key /root/foo_com/foo_com.key;

  ssl_session_timeout 5m;

  ssl_protocols SSLv3 TLSv1 TLSv1.1 TlSv1.2;
  ssl_ciphers ALL:!ADH:!aNULL:!PSK:!MD5:!AES:!EXPORT:+HIGH:!MEDIUM:!LOW:!SSLv2;
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:syncserver:4m;

  location / {
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
    proxy_read_timeout 120;
    proxy_connect_timeout 10;
    proxy_pass https://192.168.0.8:20343;
  }
}

在第二次安装时,我的 Xcode 服务器位于完全公共 IP 上,问题实际上有所不同:由于某种原因,我的设备没有正确接受 Xcode 服务器用于在端口 20343 上运行的 Node.js 服务器的根证书。

你可以在这里找到我的解决方案:Xcode bot install link request time out

于 2015-03-04T16:13:16.703 回答