Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Phil Pirozhkov pirj
file 20 lines (16 sloc) 0.467 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
require 'net/https'

Net::HTTP.class_eval do
  alias _use_ssl= use_ssl=

  def use_ssl= boolean
    self.ca_file = "#{File.dirname(__FILE__)}/certs/ca-bundle.crt"
    self.verify_mode = OpenSSL::SSL::VERIFY_PEER
    self._use_ssl = boolean
  end
end

OpenSSL::X509::Store.class_eval do
  alias _set_default_paths set_default_paths

  def set_default_paths
    self._set_default_paths
    self.add_file "#{File.dirname(__FILE__)}/certs/ca-bundle.crt"
  end
end
Something went wrong with that request. Please try again.