Skip to content

Instantly share code, notes, and snippets.

@kotlav
Last active July 27, 2017 15:39
Show Gist options
  • Save kotlav/17d62dc3dcb7799aff20edb3a8f310ed to your computer and use it in GitHub Desktop.
Save kotlav/17d62dc3dcb7799aff20edb3a8f310ed to your computer and use it in GitHub Desktop.
Solution to error "SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed"

Another solution

Get the latest cacert.pem file from wget http://curl.haxx.se/ca/cacert.pem And set these two ENV vars
export SSL_CERT_DIR=/path-to_pem_dir
export SSL_CERT_FILE=/path-to_pem_file

Best solution

Re-install your rvm ruby version without the binary.
rvm uninstall <your_ruby_version>
rvm install <your_ruby_version> --disable-binary

# frozen_string_literal: true
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2,
ENV['OAUTH_CLIENT_ID'],
ENV['OAUTH_CLIENT_SECRET'],
client_options: {
ssl: {
ca_file: Rails.root.join('cacert.pem').to_s
}
},
scope: 'email, profile, https://www.googleapis.com/auth/calendar',
hd: 'example.com'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment