This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
require 'openssl' | |
ssl_context = OpenSSL::SSL::SSLContext.new | |
tcp_client = TCPSocket.new 'server.trustwave.com', 443 | |
ssl_client = OpenSSL::SSL::SSLSocket.new tcp_client, ssl_context | |
ssl_client.connect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'socket' | |
=> true | |
>> require 'openssl' | |
=> true | |
>> | |
?> ssl_context = OpenSSL::SSL::SSLContext.new | |
=> #<OpenSSL::SSL::SSLContext:0x007f8b53049058> | |
>> tcp_client = TCPSocket.new 'server.trustwave.com', 443 | |
=> #<TCPSocket:fd 5> | |
>> ssl_client = OpenSSL::SSL::SSLSocket.new tcp_client, ssl_context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> ssl_context.verify_mode | |
=> nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'socket' | |
=> true | |
>> require 'openssl' | |
=> true | |
>> | |
?> ssl_context = OpenSSL::SSL::SSLContext.new | |
=> #<OpenSSL::SSL::SSLContext:0x007fc4a09e3740> | |
>> ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
=> 1 | |
>> tcp_client = TCPSocket.new 'server.trustwave.com', 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> ssl_context.cert_store | |
=> nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_default_paths | |
@cacerts_loaded = true # avoid lazy override | |
@cert_store = X509::Store.new | |
@cert_store.set_default_paths | |
change_notify | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'handsoap/http/drivers/abstract_driver' | |
module Handsoap | |
module Http | |
module Drivers | |
class HttpClientDriver < AbstractDriver | |
def self.load! | |
require 'httpclient' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'handsoap/http/drivers/abstract_driver' | |
module Handsoap | |
module Http | |
module Drivers | |
class HttpClientDriver < AbstractDriver | |
def self.load! | |
require 'httpclient' | |
end |