class Excon::Connection

def establish_connection

def establish_connection
  connection = TCPSocket.open(@uri.host, @uri.port)
  if @uri.scheme == 'https'
    @ssl_context = OpenSSL::SSL::SSLContext.new
    @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
    connection = OpenSSL::SSL::SSLSocket.new(connection, @ssl_context)
    connection.sync_close = true
    connection.connect
  end
  connection
end