我有一个Ruby Gemserver通过端口9392上的http Geminabox运行。
它是HAProxy负载均衡器的背后,它正在强制执行https并进行SSL终止。这是我的haproxy.cfg的相关块:
global
daemon
maxconn 256
user nobody
tune.ssl.default-dh-param 2048
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
option httpclose
frontend http-in
bind *:80
reqadd X-Forwarded-Proto:\ http
redirect scheme https if !{ ssl_fc }
frontend www-https
reqadd X-Forwarded-Proto:\ https
bind *:443 ssl crt /usr/local/etc/haproxy/***********.pem
default_backend home_server
acl is_gems hdr(host) -i gems.example.com
use_backend gems if is_gems
backend gems
server gems1 192.168.100.102:9392 ssl verify none
当我尝试从任何其他机器添加我的gemserver时:
Error fetching https://gems.example.com:
SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://gems.boynton.io/specs.4.8.gz)
有趣的是,无论gemserver是否正在运行,这仍然是正确的,这让我相信我的本地ruby gem
客户端拒绝了证书。(否则我' d已将此问题困在ServerFault中)
证书是Comodo PositiveSSL通配符证书,而不是自签名证书。我已经确认CA证书在我的本地信任存储区(我在OS X El Cap上,所以它已被添加到我的钥匙串中)。似乎gem
命令可能没有使用我的系统信任存储。
我在这上面搜索了两三天无济于事 - 我能找到的所有内容都与rubygems.org有关并建议gem update --system
(我正在运行最新的rubygems)或切换到{{ 1}},这两个都是rubygems.org特有的修复。
如何让http
使用我的本地信托存储或获取额外的证书?