# [PATCH] git-send-email: Fix authenticating on some servers when using TLS.

2 messages from 2008-07-09 to 2008-07-09. Participants: Robert Shearman, Junio C Hamano.
Thread: https://gitlist.dev/t/14386

## Robert Shearman, 2008-07-09 21:39

Subject: [PATCH] git-send-email: Fix authenticating on some servers when using TLS.
Message-ID: <1215639580-25040-1-git-send-email-robertshearman@gmail.com>
URL: https://gitlist.dev/e/1215639580-25040-1-git-send-email-robertshearman%40gmail.com

```
Send hello after a successful STARTTLS command to refresh the list of extensions. These may be different to what is returned over a clear connection (for example the AUTH command may be accepted over a secure connection, but not over a clear connection).

Furthermore, this behaviour is recommended by RFC 2487 (http://www.ietf.org/rfc/rfc2487.txt).

Signed-off-by: Robert Shearman <robertshearman@gmail.com>
---
 git-send-email.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 3564419..6adb669 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -773,6 +773,9 @@ X-Mailer: git-send-email $gitversion
 					$smtp = Net::SMTP::SSL->start_SSL($smtp)
 						or die "STARTTLS failed! ".$smtp->message;
 					$smtp_encryption = '';
+					# Send EHLO again to receive fresh
+					# supported commands
+					$smtp->hello();
 				} else {
 					die "Server does not support STARTTLS! ".$smtp->message;
 				}
-- 
1.5.6.2.224.g26efb.dirty

```

## Junio C Hamano, 2008-07-09 22:51

Subject: Re: [PATCH] git-send-email: Fix authenticating on some servers when using TLS.
Message-ID: <7v1w227jtu.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v1w227jtu.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1215639580-25040-1-git-send-email-robertshearman@gmail.com>

```
Robert Shearman <robertshearman@gmail.com> writes:

> Send hello after a successful STARTTLS command to refresh the list of extensions. These may be different to what is returned over a clear connection (for example the AUTH command may be accepted over a secure connection, but not over a clear connection).
>
> Furthermore, this behaviour is recommended by RFC 2487 (http://www.ietf.org/rfc/rfc2487.txt).

Very true.  Thanks.

```
