简体   繁体   English

OpenSSL :: SSL :: SSLError(连接到Paypal时,返回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) while connecting to Paypal

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. 我知道有关此错误的讨论很多,但是很抱歉我无法在那找到任何可行的解决方案。

I'm developing a ecommerce site using ShareTribe .I'm trying to implement Paypal as payment gateway.So I'm using Activemerchant . 我正在使用ShareTribe开发一个电子商务网站。我正在尝试将Paypal实现为支付网关 。所以我正在使用Activemerchant

Everything works fine on development machine but when I deploy my rails app to production It throws 在开发机器上一切正常,但是当我将Rails应用程序部署到生产环境时会抛出异常

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

I'm initializing my Activemerchant as 我正在将Activemerchant初始化为

 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

Added HTTPS and Disabled SSLV3 添加了HTTPS和禁用的SSLV3

After lots of googling I found that 经过大量的搜寻后,我发现

SSLv3 was proven to be insecure with the POODLE vulnerability. 事实证明,SSLv3具有POODLE漏洞是不安全的。 You should make sure that your system has the latest version of OpenSSL so that you can use TLSv1.2. 您应该确保系统具有最新版本的OpenSSL,以便可以使用TLSv1.2。

So I disabled SSLV3 as shown below 所以我禁用了SSLV3,如下所示

 openssl s_client -connect kickmarket.eu:443
CONNECTED(00000003)
depth=0 OU = Domain Control Validated, OU = PositiveSSL, CN = www.kickmarket.eu
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL, CN = www.kickmarket.eu
verify error:num=27:certificate not trusted
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL, CN = www.kickmarket.eu
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/OU=Domain Control Validated/OU=PositiveSSL/CN=www.kickmarket.eu
   i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
---
Server certificate
-----BEGIN CERTIFICATE-----
...........................................
-----END CERTIFICATE-----
subject=/OU=Domain Control Validated/OU=PositiveSSL/CN=www.kickmarket.eu
issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
---
No client certificate CA names sent
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 2038 bytes and written 375 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: 4D23F4A942AAD4264BE96EB5F1E62204269D882A64ACFBD2D139CD2F10A449A0
    Session-ID-ctx: 
    Master-Key: 1E381DAA3BA90FE3609606716E7E9A2EB2E2F671E9F3C4005D8EBAE009103A7AB771FB2AC8B45F169F43CBD0AD352E06
    Key-Arg   : None
    Krb5 Principal: None
    PSK identity: None
    PSK identity hint: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
   ..................................

    Start Time: 1446132175
    Timeout   : 300 (sec)
    Verify return code: 21 (unable to verify the first certificate)
---

But after restarting nginx I got the same problem.Is there Any way to fix this issue. 但是重启nginx之后我遇到了同样的问题,是否有任何方法可以解决这个问题。 Any suggestion will be appreciated. 任何建议将不胜感激。

This is most likely due to the upgrade to SHA256 certification. 这很可能是由于升级到SHA256认证所致。 Please review the following documentation: 请查看以下文档:

https://devblog.paypal.com/paypal-ssl-certificate-changes/ https://devblog.paypal.com/paypal-ssl-certificate-changes/

The primary cause for this is the rvm installed ruby does look into the wrong directory for certificates whereas the OSX-ruby will look into the correct one. 造成这种情况的主要原因是,安装了rvm的ruby确实在错误的证书目录中进行了查找,而OSX-ruby会在正确的目录中进行查找。

What you wanna do is NOT TO USE any of the precompiled rubies and rather have ruby compiled on your local machine, like so: 您想要做的是不使用任何预编译的红宝石,而是在本地计算机上编译红宝石,如下所示:

rvm install 2.2.0 --disable-binary

You can read detailed explanation https://toadle.me/2015/04/16/fixing-failing-ssl-verification-with-rvm.html 您可以阅读详细说明https://toadle.me/2015/04/16/fixing-failing-ssl-verification-with-rvm.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 connect:SSL_connect返回= 1 errno = 0 state = SSLv3读取服务器证书B:证书验证失败(OpenSSL :: SSL :: SSLError) - connect: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) Heroku Rails Net :: HTTP:OpenSSL :: SSL :: SSLError:SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败 - Heroku Rails Net::HTTP: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed OpenSSL :: SSL :: SSLError:SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败-向外部API耙任务 - OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed - rake task to external API SSL_connect 返回=1 errno=0 state=SSLv3 读取服务器证书B:证书验证失败 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败的MAC - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed MAC SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:Mac上的证书验证失败 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed on Mac SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证仅在代理时失败 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ONLY WHEN PROXYING OpenSSL::SSL::SSLError: SSL_connect SYSCALL 返回=5 errno=0 state=SSLv3 read server hello A - OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A SSL_connect SYSCALL返回= 5 errno = 0 state = SSLv3读取服务器hello A(OpenSSL :: SSL :: SSLError) - SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A (OpenSSL::SSL::SSLError) SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器问候A:错误的版本号(OpenSSL :: SSL :: SSLError) - SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: wrong version number (OpenSSL::SSL::SSLError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM