Skip to content

Commit

Permalink
Added SNI support. see #49.
Browse files Browse the repository at this point in the history
Should I add an option to disable tlsext?
  • Loading branch information
Hiroshi Nakamura committed Jan 11, 2011
1 parent c65457e commit a65bbbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/httpclient/session.rb
Expand Up @@ -261,7 +261,10 @@ def initialize(socket, context, debug_dev = nil)
@debug_dev = debug_dev
end

def ssl_connect
def ssl_connect(hostname = nil)
if hostname && @ssl_socket.respond_to?(:hostname=)
@ssl_socket.hostname = hostname
end
@ssl_socket.connect
end

Expand Down Expand Up @@ -695,7 +698,7 @@ def connect
else
@socket = create_ssl_socket(@socket)
connect_ssl_proxy(@socket, URI.parse(@dest.to_s)) if @proxy
@socket.ssl_connect
@socket.ssl_connect(@dest.host)
@socket.post_connection_check(@dest)
@ssl_peer_cert = @socket.peer_cert
end
Expand Down

0 comments on commit a65bbbd

Please sign in to comment.