Skip to content

Instantly share code, notes, and snippets.

@claudijd
Created June 28, 2013 14:45
Show Gist options
  • Save claudijd/5885221 to your computer and use it in GitHub Desktop.
Save claudijd/5885221 to your computer and use it in GitHub Desktop.
httpclient SSLConfig initlialization
# Creates a SSLConfig.
def initialize(client)
return unless SSLEnabled
@client = client
@cert_store = X509::Store.new
@client_cert = @client_key = @client_ca = nil
@verify_mode = SSL::VERIFY_PEER | SSL::VERIFY_FAIL_IF_NO_PEER_CERT
@verify_depth = nil
@verify_callback = nil
@dest = nil
@timeout = nil
@ssl_version = "SSLv3"
@options = defined?(SSL::OP_ALL) ? SSL::OP_ALL | SSL::OP_NO_SSLv2 : nil
# OpenSSL 0.9.8 default: "ALL:!ADH:!LOW:!EXP:!MD5:+SSLv2:@STRENGTH"
@ciphers = "ALL:!aNULL:!eNULL:!SSLv2" # OpenSSL >1.0.0 default
@cacerts_loaded = false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment