0

我正在尝试在 Resque 的生产环境版本上调试失败的作业,因为这是我可以使用的所有 Web 界面:

Worker:      9c9fe9d3-8ee0-43fe-afcd-c6806fc75f0d:2 on sentiment_pull at just now
Class:       SentimentJob
Arguments:   [16, 17, 18]13
Exception:   OpenSSL::SSL::SSLError
Error:       SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

这在开发中有效,我不确定为什么我会在 Heroku 上收到 OpenSSL 错误。我也在使用 Omniauth,所以在我已经设置的初始化程序中:

Rails.application.config.middleware.use OmniAuth::Builder do  
  provider #...
  :client_options => {:ssl => {:ca_path => "/etc/ssl/certs"}}
end

我没有在 Heroku 上找到任何需要 SSL 证书的 Resque 示例,所以我有点难过,因为该作业设置为在 HTTPS URL 上执行请求。

4

1 回答 1

0

我最近遇到了这个问题,尽管有很多关于如何解决它的答案,但这是唯一对我有用的问题(我不在 Heroku 上,而是在 Debian VPS 上)。大多数时候这是一个坏主意,但对于我需要接受自签名 SSL 记录的用例来说很好。

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

这将导致 OpenSSL 不验证 SSL 记录并抑制错误。

于 2012-06-22T06:53:53.303 回答