2

我已经根据https://github.com/ryanb/private_pub#serving-faye-over-https-with-thin设置了带有 SSL 的私人酒吧,还添加了daemonize: true(有无测试)。

我可以浏览https://mydomain.com:4443/faye.js并加载。

页面上没有错误。

然而,实际上没有任何工作,即没有实时事件触发。尝试PrivatePub.publish_to在控制台中时,我得到:

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

当我运行非守护程序的瘦服务器时,我可以看到它<SSL_incomp>在尝试 publish_to 时返回。

服务器上的 SSL 工作正常,我该如何解决这个问题?

4

2 回答 2

3

我设法通过将内容附加到苗条配置中指定ca-bundle的文件来解决这个问题crt

于 2013-12-10T09:41:28.607 回答
0

请找到解决此问题的正确方法。

当您仅使用 yourdomain.crt 文件时,private_pub 在与 rails 服务器握手时将无法工作。

因此,您的 SSL 证书提供商将为您提供 middle.crt 或 CAbundle 文件。

只要你有 CA 提供的 ca-bundle 文件

*cat yourdomain.crt whatever.ca-bundle > yourdomainfinal.crt*

如果你有中级证书

*cat yourdomain.crt intermediate.crt > yourdomainfinal.crt*

然后在运行服务器时使用 yourdomainfinal.crt 和您的私钥 yourdomain.key 指向 ssl 验证。

请找到瘦服务器的块

---
chdir: "/home/your/project/path"
environment: "your environment"
timeout: 30
log: "/home/your/project/path/log/thin.log"
pid: /home/your/project/path/tmp/pids/thin.pid
max_conns: 1024
require: []

max_persistent_conns: 1000
wait: 30
threadpool_size: 20
servers: 1
threaded: true
socket: /tmp/thin.sock

ssl: true
ssl_key_file: /home/your/project/path/ssl/yourdomain.key
ssl_cert_file: /home/your/project/path/ssl/yourdomainfinal.crt

对于私人酒吧

要在 ssl 上使用私有 pub,请在 private_pub_thin.yml 中使用以下配置

---
port: 4443
ssl: true
ssl_key_file: /path/to/yourdomain.key
ssl_cert_file: /path/to/yourdomainfinal.crt
environment: "your environment"
rackup: private_pub.ru

然后使用以下命令运行服务器

*thin -C config/private_pub_thin.yml start*

如果您正在使用捆绑器,请不要忘记使用

*RAILS_ENV="your environment" bundle exec thin -C config/private_pub_thin.yml start*

当你使用 bundler 时,上面的命令很重要,如果你不这样做,那么你的私人 pub 将启动并且在运行服务器时没有问题,但它不会发布消息。这就是我观察到的。

请注意,请检查天气,您的服务器的防火墙设置中允许端口 4443 使用**sudo ufw status**

而已!!!如果您按照上述所有指定步骤操作,您应该让 private_pub 用于生产或通过 SSL 进行 uat。

于 2019-01-07T11:08:22.890 回答