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)