Skip to content

Instantly share code, notes, and snippets.

@mehmetaydogduu
Created March 12, 2017 20:56
Show Gist options
  • Save mehmetaydogduu/d201c4911c71e6198f64d11a3b6cfa7b to your computer and use it in GitHub Desktop.
Save mehmetaydogduu/d201c4911c71e6198f64d11a3b6cfa7b to your computer and use it in GitHub Desktop.
RestClient, Faraday, Http, Api
# Find the directory which ruby searches openssl
ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'
# Download cacert.pem to that directory
!! The file names must be same !!
https://curl.haxx.se/ca/cacert.pem
Example for linux:
ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'
output: /etc/ssl/cert.pem
cd /etc/ssl/
sudo wget https://curl.haxx.se/ca/cacert.pem
mv cacert.pem cert.pem
Test it:
gem install rest-client
irb -> require 'rest-client'
#true
irb -> RestClient.get "youtube.com"
#Must be output like this
=> <RestClient::Response 200 " <!DOCTYPE...">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment