diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 460ad08..86558ff 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -581,6 +581,7 @@ def tlsconnect(s) 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 != OpenSSL::SSL::VERIFY_NONE s.post_connection_check(@address)