diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index a195f2664d..810da77df4 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -600,6 +600,7 @@ module Net s = ssl_socket(s, @ssl_context) logging "TLS connection started" s.sync_close = true + s.hostname = @address if s.respond_to? :hostname= ssl_socket_connect(s, @open_timeout) if @ssl_context.verify_mode && @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE s.post_connection_check(@address)