Rails, OpenSSL error: certificate verify failed

时间:2015-07-28 15:42:06

标签: ruby-on-rails ruby paypal openssl paypal-sandbox

I'm jumping in to make some changes in a rails app that uses activemerchant and paypal for payments. There are no problems in production with the connection but I can't get it to connect paypals sandbox from my local machine.

I'm getting SSL_connect returned=1 errno=0 state=error: certificate verify failed error in the browser when trying to checkout through paypal.

There are loads of articles and questions about similar problems but nothing i've seen seems to fix it... I've tried updating cert.pem in openssl. Also tried different versions of ruby, openssl etc

Tested with doctor.rb:

ruby doctor.rb www.sandbox.paypal.com works (edited)

OS: Osx Yosemite

Ruby: 2.1.6

Rails: 3.2.11

OpenSSL: 1.0.2d

1 个答案:

答案 0 :(得分:0)

  

...:SSLError:hostname" sandbox.paypal.com"与服务器证书不匹配

您获得的证书仅适用于www.sandbox.paypal.com,因此与sandbox.paypal.com不符。请使用正确的主机名。