使用 Omniauth 时出现 OpenSSL 错误,指定了 ssl 路径但不起作用
当我的网站获取 /auth/twitter 时,我得到以下信息:
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):
我修改了 twitter 的omniauth 配置:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, 'BLANKED', 'BLANKED', {:client_options => {:ssl => {:ca_path => "/etc/ssl/certs/"}}}
end
没有骰子。
检查了路径 /etc/ssl/certs/ ,据我所知它存在。
我使用的是omniauth 0.2.6 和faraday 0.6.1。
When my site get /auth/twitter, I got this:
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):
I modified the omniauth configuration for twitter:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, 'BLANKED', 'BLANKED', {:client_options => {:ssl => {:ca_path => "/etc/ssl/certs/"}}}
end
No dice.
Checked the path, /etc/ssl/certs/ and it exists as far as I can tell.
I am using omniauth 0.2.6 and faraday 0.6.1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将以下行添加到文件 config/initializers/omniauth.rb 会有所帮助!
但此配置不会验证您的 SSL 证书。很久以前,我为我的一个暂存应用程序执行了此操作,该应用程序没有 SSL,所以要小心!
不要在生产中这样做。
Adding the following lines to the file config/initializers/omniauth.rb helps!
But this config will not verify your SSL certificates. I did this a long time ago for one of my app in staging which didn't have SSL so beware!
Don't do this in production.
您不是唯一遇到此问题的人。这似乎是最新版本的omniauth 和faraday 的一个已知问题。检查 github 上的问题以保持最新状态:https://github.com/intridea/ omniauth/问题/404
You are not the only one with this problem. It seems to be a known issue with the latest version of omniauth and faraday. Check the issue on github to stay up-to-date: https://github.com/intridea/omniauth/issues/404
该问题是 Twitter 特有的,请参阅:
https://groups。 google.com/forum/#!topic/twitter-development-talk/THQegQjSScs
https://dev.twitter.com/discussions/533
The problem is Twitter-specific, see:
https://groups.google.com/forum/#!topic/twitter-development-talk/THQegQjSScs
https://dev.twitter.com/discussions/533