如何摆脱 OpenSSL::SSL::SSLError [英] How to get rid of OpenSSL::SSL::SSLError

查看:43
本文介绍了如何摆脱 OpenSSL::SSL::SSLError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 OmniAuth 对 Facebook 用户进行身份验证.最初,它正在工作,但一路上它只是停止工作并开始给我这个错误消息:

I am trying to authenticate users with Facebook using OmniAuth. Initially, it was working, but along the way it just stopped working and started to give me this error message:

OpenSSL::SSL::SSLError SSL_connect返回=1 错误号=0 状态=SSLv3 读取服务器证书B:证书验证失败

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

同样的代码适用于 Twitter,我似乎无法理解为什么它不适用于 Facebook.我在网上寻求帮助,但我没有成功.

The same code works well for Twitter and I can't seem to understand why it doesn't work for Facebook. I have looked online for help, but I haven't been successful.

这是我正在构建的网站的链接:http://www.bestizz.com/
这个网址会给你错误信息:http://www.bestizz.com/auth/facebook

This is the link to the website I am building: http://www.bestizz.com/
And this url would give you the error message: http://www.bestizz.com/auth/facebook

推荐答案

Ruby 找不到任何根证书.这是一个用于调试目的的选项.将以下代码放在脚本的开头:

Ruby cannot find any root certificates. Here is an option for debugging purposes. Put following code at the begining of your script:

   require 'openssl'
   OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

这篇关于如何摆脱 OpenSSL::SSL::SSLError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆