# [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption

7 messages from 2022-10-10 to 2022-10-11. Participants: sndanailov@wired4ever.net, Junio C Hamano, brian m. carlson, Aaron Schrab, Philip Oakley, Sotir Danailov.
Thread: https://gitlist.dev/t/58594

## sndanailov@wired4ever.net, 2022-10-10 17:28

Subject: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <20221010172859.13832-1-sndanailov@wired4ever.net>
URL: https://gitlist.dev/e/20221010172859.13832-1-sndanailov%40wired4ever.net

```
From: Sotir Danailov <sndanailov@wired4ever.net>

New explanation for the difference between these values.
It's hard to understand what they do based only on the names.

Signed-off-by: Sotir Danailov <sndanailov@wired4ever.net>
---
 Documentation/git-send-email.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 3290043053..4db32f05f0 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -178,8 +178,11 @@ Sending
 	for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH.
 
 --smtp-encryption=<encryption>::
-	Specify the encryption to use, either 'ssl' or 'tls'.  Any other
-	value reverts to plain SMTP.  Default is the value of
+	Specify the encryption to use, either 'ssl' or 'tls'. Any other
+	value reverts to plain SMTP. The difference between the two for Git is
+	that 'ssl' uses implicit encryption and defaults to port 465, 'tls'
+	uses explicit encryption and defaults to port 25. Other ports might be
+	used by the SMTP server. Default is the value of
 	`sendemail.smtpEncryption`.
 
 --smtp-domain=<FQDN>::
-- 
2.37.3


```

## Junio C Hamano, 2022-10-10 19:11

Subject: Re: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <xmqqy1tn1ojw.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqy1tn1ojw.fsf%40gitster.g
In-Reply-To: <20221010172859.13832-1-sndanailov@wired4ever.net>

```
sndanailov@wired4ever.net writes:

> From: Sotir Danailov <sndanailov@wired4ever.net>
>
> New explanation for the difference between these values.
> It's hard to understand what they do based only on the names.

True.  The names we use, 'ssl' and 'tls', emerged historically and
are not the best ones in retrospect.

It may also help understanding if you mentioned STARTTLS somewhere
in the description of "explicit" one, as (some) readers may be more
familiar with that term than "implicit vs explicit".

>  --smtp-encryption=<encryption>::
> -	Specify the encryption to use, either 'ssl' or 'tls'.  Any other
> -	value reverts to plain SMTP.  Default is the value of
> +	Specify the encryption to use, either 'ssl' or 'tls'. Any other
> +	value reverts to plain SMTP. The difference between the two for Git is
> +	that 'ssl' uses implicit encryption and defaults to port 465, 'tls'
> +	uses explicit encryption and defaults to port 25. Other ports might be
> +	used by the SMTP server. Default is the value of
>  	`sendemail.smtpEncryption`.
>  
>  --smtp-domain=<FQDN>::



```

## brian m. carlson, 2022-10-10 19:44

Subject: Re: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <Y0R2AwKuXAVMP5Ma@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/Y0R2AwKuXAVMP5Ma%40tapette.crustytoothpaste.net
In-Reply-To: <20221010172859.13832-1-sndanailov@wired4ever.net>

```
On 2022-10-10 at 17:28:59, sndanailov@wired4ever.net wrote:
> From: Sotir Danailov <sndanailov@wired4ever.net>
> 
> New explanation for the difference between these values.
> It's hard to understand what they do based only on the names.
> 
> Signed-off-by: Sotir Danailov <sndanailov@wired4ever.net>
> ---
>  Documentation/git-send-email.txt | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index 3290043053..4db32f05f0 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -178,8 +178,11 @@ Sending
>  	for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH.
>  
>  --smtp-encryption=<encryption>::
> -	Specify the encryption to use, either 'ssl' or 'tls'.  Any other
> -	value reverts to plain SMTP.  Default is the value of
> +	Specify the encryption to use, either 'ssl' or 'tls'. Any other
> +	value reverts to plain SMTP. The difference between the two for Git is
> +	that 'ssl' uses implicit encryption and defaults to port 465, 'tls'
> +	uses explicit encryption and defaults to port 25. Other ports might be
> +	used by the SMTP server. Default is the value of
>  	`sendemail.smtpEncryption`.

This is a definite improvement, but maybe we'd want to say that 'tls' is
really STARTTLS, while 'ssl' is always-on encryption over a dedicated
port.  It might also be worth mentioning that the choice of name doesn't
affect the actual protocol and version used and the user is almost
certainly using TLS either way.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

```

## Junio C Hamano, 2022-10-10 23:56

Subject: Re: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <xmqq35bvz10b.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq35bvz10b.fsf%40gitster.g
In-Reply-To: <Y0R2AwKuXAVMP5Ma@tapette.crustytoothpaste.net>

```
"brian m. carlson" <sandals@crustytoothpaste.net> writes:

>>  --smtp-encryption=<encryption>::
>> +	Specify the encryption to use, either 'ssl' or 'tls'. Any other
>> +	value reverts to plain SMTP. The difference between the two for Git is
>> +	that 'ssl' uses implicit encryption and defaults to port 465, 'tls'
>> +	uses explicit encryption and defaults to port 25. Other ports might be
>> +	used by the SMTP server. Default is the value of
>>  	`sendemail.smtpEncryption`.
>
> This is a definite improvement, but maybe we'd want to say that 'tls' is
> really STARTTLS, while 'ssl' is always-on encryption over a dedicated
> port.  It might also be worth mentioning that the choice of name doesn't
> affect the actual protocol and version used and the user is almost
> certainly using TLS either way.

So, it is not really specifying "the encryption", rather the way to
get into the encrypted communication.

I think the prose is OK, as long as we are not adding the third
value, at which time we may want to use enumeration instead.

        Specify how SMTP connection should be entered into encrypted
        mode.  The valid values are 'ssl' and 'tls'. Any other value
        reverts to plain (unencrypted) SMTP.  'ssl' refers to "implicit"
        encryption (sometimes calls SMTPS) that uses port 465 or 587 by
        default. 'tls' refers to "explicit" encryption (often known as
        STARTTLS) that uses port 25 by default.  Despite their names, it
        is likely the user is using the newer TLS protocol, not the
        deprecated SSL, for the actual encryption protocol either way.
    +
    Other ports might be used by the SMTP server. Default is the value of
    `sendemail.smtpEncryption`.

We might want to

 * introduce synonyms implicit/smtps vs explicit/starttls and
   deprecate the current confusing names over time?

 * error out when invalid value is given, instead of silently
   talking plaintext SMTP?


```

## Aaron Schrab, 2022-10-11 00:20

Subject: Re: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <Y0S2wyfUF1mZaryi@pug.qqx.org>
URL: https://gitlist.dev/e/Y0S2wyfUF1mZaryi%40pug.qqx.org
In-Reply-To: <xmqq35bvz10b.fsf@gitster.g>

```
At 16:56 -0700 10 Oct 2022, Junio C Hamano <gitster@pobox.com> wrote:
>        Specify how SMTP connection should be entered into encrypted
>        mode.  The valid values are 'ssl' and 'tls'. Any other value
>        reverts to plain (unencrypted) SMTP.  'ssl' refers to "implicit"
>        encryption (sometimes calls SMTPS) that uses port 465 or 587 by
>        default.

There can be only one actual default port for each of the settings and 
here that is 465.

Also, port 587 belongs with the 'tls' value. Perhaps saying something 
like:

     uses port 25 by default, but port 587 is often used as well.

>        'tls' refers to "explicit" encryption (often known as
>        STARTTLS) that uses port 25 by default.  Despite their names, it
>        is likely the user is using the newer TLS protocol, not the
>        deprecated SSL, for the actual encryption protocol either way.

```

## Philip Oakley, 2022-10-11 14:06

Subject: Re: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <69ba0bb5-19c1-e54e-bc06-515a17380494@iee.email>
URL: https://gitlist.dev/e/69ba0bb5-19c1-e54e-bc06-515a17380494%40iee.email
In-Reply-To: <Y0S2wyfUF1mZaryi@pug.qqx.org>

```
On 11/10/2022 01:20, Aaron Schrab wrote:
> At 16:56 -0700 10 Oct 2022, Junio C Hamano <gitster@pobox.com> wrote:
>>        Specify how SMTP connection should be entered into encrypted
>>        mode.  The valid values are 'ssl' and 'tls'. Any other value
>>        reverts to plain (unencrypted) SMTP.  'ssl' refers to "implicit"
>>        encryption (sometimes calls SMTPS) that uses port 465 or 587 by
>>        default.
>
> There can be only one actual default port for each of the settings and
> here that is 465.
>
> Also, port 587 belongs with the 'tls' value. Perhaps saying something
> like:
>
>     uses port 25 by default, but port 587 is often used as well.
>
>>        'tls' refers to "explicit" encryption (often known as
>>        STARTTLS) that uses port 25 by default.  Despite their names, it
>>        is likely the user is using the newer TLS protocol, not the
>>        deprecated SSL, for the actual encryption protocol either way.

I support the feeling that the documentation needs a bit of updating.

I found that I just couldn't manage to set up a send-email configuration
for one of my ISPs who was using non-default settings, and I never
managed to work out what was required, or decode if the script was
trying to enforce the default in some cases (i.e. it wasn't a 'default'
that could be changed!).

That ISP has recently consolidated its options (it has many legacy UK
email domains) to limit it's exposure to security holes, so I may retry
at some point(not this month), but it can be frustrating trying to debug
these failures in setups.

Philip



```

## Sotir Danailov, 2022-10-11 15:49

Subject: Re: [PATCH] docs: git-send-email: difference between ssl and tls smtp-encryption
Message-ID: <7f62a170-c3cf-0911-5c76-2b2565674189@wired4ever.net>
URL: https://gitlist.dev/e/7f62a170-c3cf-0911-5c76-2b2565674189%40wired4ever.net
In-Reply-To: <Y0S2wyfUF1mZaryi@pug.qqx.org>

```
On Tue 11 Oct 2022 02:20, Aaron Schrab wrote:
> uses port 25 by default, but port 587 is often used as well

Well, I was trying to explain that the script would default to that port.
I like your idea as well, but I'm not sure if it will make things clearer.
I'm making a second version of the patch now. I will try to balance out
all of the ideas into something I feel might be easy to follow.

```
