spree-contrib / better_spree_paypal_express

A better Spree PayPal Express Extension.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
110 stars 270 forks source link

Fails In Production When SSL Is Used #213

Open MatthewKennedy opened 3 years ago

MatthewKennedy commented 3 years ago

This extension was working fine for years, never an issue, I made no changes to my code or production environment and then I woke up to a roller error log email (shown below), and a message from a potential customer saying they can not checkout.

I have no idea why this should randomly occur, what caused it, or how to fix it.

It may not even be a Spree issue, but if anyone else has come across this issue and fixed it it would be great to know how and document it for others.

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)

mick-t commented 3 years ago

I am seeing a similar issue.

MatthewKennedy commented 3 years ago

I am seeing a similar issue.

For a quick fix, replace:

gem 'spree_paypal_express', github: 'spree-contrib/better_spree_paypal_express'

With:

gem 'spree_paypal_express', github: 'welaika/better_spree_paypal_express', branch: 'fix_expired_ssl_certificate_error

And run: bundle update spree_paypal_express

mick-t commented 3 years ago

Now getting a "Repository not found" error for the spree-3-7 repo:

bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching https://github.com/spree-3-7/better_spree_paypal_express.git
Username for 'https://github.com': 
Password for 'https://github.com': 
remote: Repository not found.

And a 404 error for:

MatthewKennedy commented 3 years ago

@mick-t Thats my fault, I've spent today deleting my unused GitHub Organisations in an attempt to be more organised, as I had repos everywhere.

You might want to Fork your own version of this extension and apply the fix then you have control over the repo, or use this fellas branch:

gem 'spree_paypal_express', github: 'welaika/better_spree_paypal_express', branch: 'fix_expired_ssl_certificate_error'

mick-t commented 3 years ago

Thanks for the advice, I've created my own fork as welaika's branch is pinned against spree 3-0-stable.

Can you advice what's the best approach going forward to take care of this?

@MatthewKennedy's commit mentions that this fixes "Error from using the old PayPal SDK", I assume the best approach is to use a new PayPal SDK? Sorry if this is a dumb question, I'm working on a application that I inherited and am not fully up to speed on all the components.

Thanks!

ctsstc commented 2 years ago

Seems my build must have been using a cache for spree-3-7/better_spree_paypal_express for who knows how long.

I did some system updates on dokku and docker which I'm now getting:

       Retrying `git clone --bare --no-hardlinks --quiet -- https://github.com/spree-3-7/better_spree_paypal_express.git /tmp/build/vendor/bundle/ruby/2.7.0/cache/bundler/git/better_spree_paypal_express-66e5ea256a0a8288860478940a41ad4900f0c464` at /tmp/build due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- https://github.com/spree-3-7/better_spree_paypal_express.git /tmp/build/vendor/bundle/ruby/2.7.0/cache/bundler/git/better_spree_paypal_express-66e5ea256a0a8288860478940a41ad4900f0c464` in directory /tmp/build has failed.

       If this error persists you could try removing the cache directory '/tmp/build'

Going to try this one now: 'welaika/better_spree_paypal_express'

Kinda sketchy using a 3rd party for paypal, but seems to have the basics in there from what I quickly can see.


Edit: also had to run this because mimemagic 3.5 bundle update --conservative mimemagic.