How to resolve OpenSSL :: SSL :: SSLError: SSL_connect on Ruby paypal-sdk-rest gem

More details will be added at a later date.

Background

From around the evening of August 11, 2020 (Japan time), the following error began to occur when paying with the paypal-sdk-rest gem.

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

How to respond

Download the latest cacert.pem from https://curl.haxx.se/docs/caextract.html, place it in config / certs / cacert.pem, and in config / paypal.yml Add the ca_file setting for ssl_options.

config/paypal.yml


development: &default
  mode: sandbox
  client_id: xxx
  client_secret: xxx
  ssl_options:
    ca_file: config/certs/cacert.pem
production:
  mode: live
  client_id: xxx
  client_secret: xxx

With this setting, it was confirmed that both the local development environment and the production environment work as expected.

Another solution

-How to resolve SSL_connect error of PayPal Ruby SDK --Qiita

reference

Recommended Posts

How to resolve OpenSSL :: SSL :: SSLError: SSL_connect on Ruby paypal-sdk-rest gem
How to resolve SSL_connect error in PayPal Ruby SDK
How to use Ruby on Rails
[Ruby on Rails] How to use redirect_to
[Ruby on Rails] How to use kaminari
How to implement gem "summer note" in wysiwyg editor in Ruby on Rails
How to make rbenv recognize OpenSSL on WSL
[Ruby on Rails] How to install Bootstrap in Rails
[Ruby on Rails] How to use session method
How to resolve errors that occur in the "Ruby on Rails" integration test
How to install Ruby on an EC2 instance on AWS
[Ruby on Rails] How to write enum in Japanese
[Ruby on Rails] How to change the column name
[Ruby On Rails] How to reset DB in Heroku
[Ruby on Rails] How to implement tagging / incremental search function for posts (without gem)
(Ruby on Rails6) How to create models and tables
How to display a graph in Ruby on Rails (LazyHighChart)
How to resolve Sprockets :: DoubleLinkError
How to resolve Git conflicts
How to use Ruby return
How to deploy on heroku
[Ruby] How to comment out
Ruby: How to use cookies
[Ruby] How to write blocks
[Ruby on Rails] "|| =" ← Summary of how to use this assignment operator
[Ruby on Rails] How to avoid creating unnecessary routes for devise
[Ruby on Rails] How to log in with only your name and password using the gem devise
[Rails] How to use gem "devise"
How to deploy jQuery on Rails
How to deploy Laravel on CentOS 7
How to iterate infinitely in Ruby
How to "hollow" View on Android
[Java] How to update Java on Windows
How to install ImageMagick on Windows 10
How to install ruby through rbenv
How to deploy Bootstrap on Rails
How to run JavaFX on Docker
How to use Bio-Formats on Ubuntu 20.04
How to install Bootstrap in Ruby
[Ruby] How to use any? Method
How to install MariaDB 10.4 on CentOS 8
Rails on Tiles (how to write)
How to resolve Mixed Content errors
How to install WildFly on Ubuntu 18.04
[Technical memo] How to resolve errors
How to build vim on Ubuntu 20.04
How to use Ruby inject method
How to execute Ruby irb (interactive ruby)
How to create a query using variables in GraphQL [Using Ruby on Rails]
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
How to solve the local environment construction of Ruby on Rails (MAC)!
How to debug the processing in the Ruby on Rails model only on the console
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
[Ruby On Rails] How to search the contents of params using include?