Skip to content

Instantly share code, notes, and snippets.

@johnl
Last active December 18, 2015 14:18
Show Gist options
  • Save johnl/5795909 to your computer and use it in GitHub Desktop.
Save johnl/5795909 to your computer and use it in GitHub Desktop.
require 'openssl'
require 'socket'
ssl_context = OpenSSL::SSL::SSLContext.new
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
ssl_context.cert_store = OpenSSL::X509::Store.new
ssl_context.cert_store.set_default_paths if File.exists? OpenSSL::Config::DEFAULT_CONFIG_FILE
socket = TCPSocket.new('api.gb1.brightbox.com', 443)
ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)
ssl_socket.connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment