summaryrefslogtreecommitdiff
path: root/lib/net/imap.rb
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 23:35:02 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 23:35:02 +0000
commite553d94f01ab5c101c26627132ed12e30a00e8f7 (patch)
tree4dde77466c45c863c07121905e096173255aebaa /lib/net/imap.rb
parent73f891f1a5dafb1709b333d953ad8b50af7ee1f9 (diff)
Support SNI
This fixes connecting using TLS 1.3 to imap.gmail.com [Fix GH-2077] [Feature #15594] From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/imap.rb')
-rw-r--r--lib/net/imap.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index fa9b19071a..1c7e89ba14 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -1530,6 +1530,7 @@ module Net
end
@sock = SSLSocket.new(@sock, context)
@sock.sync_close = true
+ @sock.hostname = @host if @sock.respond_to? :hostname=
ssl_socket_connect(@sock, @open_timeout)
if context.verify_mode != VERIFY_NONE
@sock.post_connection_check(@host)