OpenSSL::SSL::SSLError(SSL_connect 返回=1 errno=0 state=SSLv3 读取服务器证书 B:证书验证失败) [英] OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed)

查看:152
本文介绍了OpenSSL::SSL::SSLError(SSL_connect 返回=1 errno=0 state=SSLv3 读取服务器证书 B:证书验证失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有很多关于此错误的讨论,但很抱歉,我无法在那里找到任何可行的解决方案.

I know there are lots of discussion regarding this error but sorry to say that I'm unable to find any working solution over there.

我正在使用 ShareTribe 开发电子商务网站.我正在尝试将 Paypal 实现为支付网关.所以我正在使用 Activemerchant.

I'm developing a ecommerce site using ShareTribe.I'm trying to implement Paypal as payment gateway.So I'm using Activemerchant.

在开发机器上一切正常,但是当我将 Rails 应用程序部署到生产环境时,它抛出

Everything works fine on development machine but when I deploy my rails app to production It throws

OpenSSL::SSL::SSLError(SSL_connect 返回=1 errno=0 state=SSLv3 读取服务器证书 B:证书验证失败)

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

我正在将我的 Activemerchant 初始化为

I'm initializing my Activemerchant as

 config.after_initialize do
    ActiveMerchant::Billing::Base.mode = :test
    paypal_options = {
        login: "bla bla",
        password: "bla bla",
        signature: "bla bla",
        appid: "APP-80W284485P519543T"
    }
    ::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalExpressGateway.new(paypal_options)

  end

我正在尝试在生产中添加 Paypal Pem 证书,但不知道如何将此文件与 Activemerchant 相关联.任何赞赏将不胜感激.谢谢

I'm trying to add Paypal Pem certificates on production but don't have any idea how to link this file with Activemerchant.Any Appreciation will be appreciated. Thank you

推荐答案

在初始化程序中创建一个文件 active_merchant.rb &输入以下代码:

Create a file active_merchant.rb in initializers & put the below code:

ActiveMerchant::Billing::Base.mode = :test
GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
:login => "bla-bla",
:password => "bla-bla",
:signature => "bla-bla"
)

ActiveMerchant::Billing::Base.mode = :test
GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
:login => "bla-bla",
:password => "bla-bla",
:signature => "bla-bla"
)

这篇关于OpenSSL::SSL::SSLError(SSL_connect 返回=1 errno=0 state=SSLv3 读取服务器证书 B:证书验证失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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