diff --git a/lib/net/http.rb b/lib/net/http.rb index a1b8d69..bf1b64c 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -822,6 +822,9 @@ module Net #:nodoc: # Sets the maximum depth for the certificate chain verification. attr_accessor :verify_depth + # Disable TLS SNI. Enabled by default, and only if TLS extensions are available. + attr_accessor :disable_sni + # Sets the flags for server the certification verification at beginning of # SSL/TLS session. # @@ -916,7 +919,9 @@ module Net #:nodoc: end s.session = @ssl_session if @ssl_session # Server Name Indication (SNI) RFC 3546 - s.hostname = @address if s.respond_to? :hostname= + unless @disable_sni + s.hostname = @address if s.respond_to? :hostname= + end Timeout.timeout(@open_timeout, Net::OpenTimeout) { s.connect } if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE s.post_connection_check(@address)