Skip to content

Instantly share code, notes, and snippets.

@claudijd
claudijd / example5.rb
Created June 28, 2013 14:40
Ruby OpenSSL using verify peer and system cert store.
>> require 'socket'
=> true
>> require 'openssl'
=> true
>>
?> ssl_context = OpenSSL::SSL::SSLContext.new
=> #<OpenSSL::SSL::SSLContext:0x007ffc9a9deb00>
>> ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
=> 1
>> cert_store = OpenSSL::X509::Store.new