Project

General

Profile

Actions

Feature #4351

closed

Server Name Indication (SNI) for net/http

Added by akr (Akira Tanaka) about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-dev:43164]

Description

=begin
ふと、SSL で name based vitual をやる話 (SNI - RFC 3546) はどうなったんだっけ、
と思って探したら、以下を見つけたので、net/http にも対処を
入れるのはどうですかね。

ssl - OpenSSL Server Name Indication support in Ruby - Stack Overflow
http://stackoverflow.com/questions/4685736/openssl-server-name-indication-support-in-ruby

対処を入れると、以下がエラーにならなくなります。

ruby -ropen-uri -e 'URI("https://gmail.com/.well-known/host-meta").read'

% svn diff --diff-cmd diff -x -u lib/net/http.rb
Index: lib/net/http.rb

--- lib/net/http.rb (revision 30734)
+++ lib/net/http.rb (working copy)
@@ -780,6 +780,7 @@
@socket.writeline ''
HTTPResponse.read_new(@socket).value
end

  •      s.hostname = @address
         timeout(@open_timeout) { s.connect }
         if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
           s.post_connection_check(@address)
    

--
[田中 哲][たなか あきら][Tanaka Akira]
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0