threads / patch / 58594

patchdocs: git-send-email: difference between ssl and tls smtp-encryption

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

## tl;dr

7 messages between Oct 10, 2022 and Oct 11, 2022. Diffs are folded; open one to read it.

replies: 6people: 5as markdown or json

sndanailov@wired4ever.net· Oct 10, 2022, 17:28 UTC · lore
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(-)
Show changes to Documentation/git-send-email.txt +5 −2
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· Oct 10, 2022, 19:11 UTC · re: sndanailov@wired4ever.net · lore

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

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".

Show 11 quoted lines
>  --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· Oct 10, 2022, 19:44 UTC · re: sndanailov@wired4ever.net · lore

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

On 2022-10-10 at 17:28:59, sndanailov@wired4ever.net wrote:
Show 26 quoted lines
> 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· Oct 10, 2022, 23:56 UTC · re: brian m. carlson · lore

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

"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 13 quoted lines
>>  --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· Oct 11, 2022, 00:20 UTC · re: Junio C Hamano · lore

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

At 16:56 -0700 10 Oct 2022, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>        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· Oct 11, 2022, 14:06 UTC · re: Aaron Schrab · lore

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

On 11/10/2022 01:20, Aaron Schrab wrote:
Show 19 quoted lines
> 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· Oct 11, 2022, 15:49 UTC · re: Aaron Schrab · lore

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

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.

← back to recent threads