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"
)