Xcode 9自带的Xcode Server现在可以自动生成用于服务器和客户端通信的SSL证书。它还在与Xcode Server REST API通信时使用此证书。是否有一种方法可以指定或替换自动生成的密钥并使用来自受信任第三方(例如LetsEncrypt)的证书?
位于apache配置文件
/Library/Developer/XcodeServer/Configuration/httpd_os_xcs.conf
包含以下信息:
Listen 443
<VirtualHost *:443>
# Xcode Server uses its own self-signed certificates
# only if no other SSL configurations for Apache have been found
<IfModule !ssl_module>
LoadModule ssl_module libexec/apache2/mod_ssl.so
SSLEngine on
SSLCertificateFile /Library/Developer/XcodeServer/Certificates/apache.crt
SSLCertificateKeyFile /Library/Developer/XcodeServer/Certificates/apache.key
</IfModule>
[...]
<IfModule mod_proxy.c>
SSLProxyEngine On
SSLProxyCheckPeerCN Off
ProxyPass /xcode/internal/api https://127.0.0.1:20343/api retry=0 timeout=30
ProxyPassReverse /xcode/internal/api https://127.0.0.1:20343/api
ProxyPass /xcode/internal/socket.io https://127.0.0.1:20343/socket.io retry=0 timeout=30
ProxyPassReverse /xcode/internal/socket.io https://127.0.0.1:20343/socket.io
</IfModule>
[...]
</VirtualHost>
我相信证书也是在找到的apache.keychain文件中的一部分
/Library/Developer/XcodeServer/Keychains/apache.keychain
但我无法验证。
每次在Xcode中启动Xcode服务器服务时,apache.{crt/key}文件以及httpd_os_xcs.conf文件都会被覆盖,因此简单地替换/修改这些文件似乎不是一个选项。
我能想到的唯一办法是实现一些其他的SSL配置,如http_os_xcs.conf文件中建议的那样,但我似乎也无法让它起作用。
非常感谢您提供任何建议或解决方案。