hin*_*erg 9 xcode ssl-certificate osx-server ios xcode-bots
我们有一个配置了SSL证书并启用了Xcode的osx服务器.在将OSX Server更新到3.2.1和Xcode 6.0.1之前,一切正常.
我们遇到的问题是,当集成完成后,我们点击设备上的安装按钮,它会尝试下载但是会无声地失败.设备日志打印:
9月22日13:32:29 somePhone itunesstored [84]:无法加载带有底层错误的下载清单:Error Domain = NSURLErrorDomain Code = -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:20343/api/integrations /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)
Run Code Online (Sandbox Code Playgroud)
这似乎是osx服务器和xcode机器人的一个错误.有没有人有我们如何在我们的设备上下载ipa文件的解决方案?
小智 4
这里同样的问题。
最初,开箱即用的 Xcode Server 解决方案可以正常工作,任何设备都可以安装 Xcode 机器人生成的 .ipa。一两天后,它突然坏了,所有设备都无法再下载,只显示:
无法连接到www.example.com
在我的 iPhone 上跟踪日志,我还可以看到设备尝试连接到https://www.example.com:20343/api/integrations。此 Xcode Web 服务显然使用自签名Xcode Server 根权限证书(而不是在 OS X Server 管理应用程序中选择的证书),并且因为任何需要访问此 Web 服务的客户端请求都被错误签名。
Apple 开发者论坛上的一篇帖子引导我找到了位于此处的 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 Server 网站公开 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>
Run Code Online (Sandbox Code Playgroud)
有趣的是 /xcode/api/ 请求是使用正确的证书进行签名的,因此可以被任何客户端接受。(您可以通过在服务器 URL 后添加 /xcode/api/integrations 来访问 Xcode 服务器来测试它。这只是一个 JSON Web 服务。如果您的服务器的证书由有效的机构签名,那么它将被接受,不会出现任何问题。)
这导致了我的两步解决方案(假设您的服务器位于路由器/防火墙后面):
1. 将公共 TCP 端口 20300、20343 重定向到防火墙/路由器中的专用 TCP 端口 443 这样,Web 服务请求将转发到使用设备自动接受的正确证书的 Xcode 服务器。Xcode 还使用端口 20344 和 20345,但将这些端口留给其他连接。注意:如果您有 OS X 服务器管理 Apple 路由器并在“公共服务”下重新切换 XCode,则这些更改可能会被覆盖。
2. 代理 /api 和 /socketio 请求到本地 web 服务 服务器不知道 /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
Run Code Online (Sandbox Code Playgroud)
最后的想法/注释:
我不确定我们是否应该将使用自签名证书的网络服务视为一个错误。Apple 提供的配置文件不正确也可能是一个问题。也许在 ProxyPass 行中删除 /xcode 部分而不是添加它们就足够了。