0

我已经在生产环境中使用 private_pub 一年多了,最近我刚刚将应用程序从 http 移动到 https。我们已经安装了签名证书,并且应用程序中的所有其他内容都在运行,但是当我 private_pub/thin 提交任何要推送的内容时,我收到以下错误。

SocketError (getaddrinfo: Name or service not known)

我无法找到与此错误和 private_pub/thin 相关的任何具体内容,但我看到的其他问题与 sunspot/solr在需要127.0.0.1时指向localhost相关。我的 private_pub 配置正在使用实际的https://domain.com

我的应用程序能够连接到 faye.js,但出现上面的服务器错误。

private_pub_thin.yml:

---
port: 4443
ssl: true
ssl_key_file: /path/to/ssl.key
ssl_cert_file: /path/to/ssl.cert
environment: production
rackup: private_pub.ru
daemonize: true

private_pub.yml:

production:
server: "https://sub.mydomain.com:4443/faye"
secret_token: "<token here>"
signature_expiration: 3600 # one hour

private_pub.ru:

require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"

Faye::WebSocket.load_adapter('thin')

PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
run PrivatePub.faye_app

任何想法将不胜感激。先感谢您

- - 编辑 - -

我没有提到这一点,但我确实在服务器的 iptables 上打开了端口 4443,我什至尝试完全关闭 iptables 进行测试。仍然有同样的错误

4

1 回答 1

1

想通了……这一切都与 SSL 证书有关。

看来我错过了 CA Bundle,或者只是没有正确安装。修复此问题,然后在此处执行此修复:Using private_pub with SSL

将 ca_bundle 附加到实际的证书上。

我还发现了一些有用的工具来帮助调试:

https://github.com/mislav/ssl-tools/tree/8b3dec4bedcc725a142fa9bc297610f8d09f5d9d https://www.digicert.com/help/

希望它可以帮助别人。

于 2015-01-15T16:11:02.517 回答