send-email-challenge: rename `tls` encryption mode to `starttls`
`tls` may be misleading, it will not use implicit TLS for the SMTP
connection as one might assume from the name. `starttls` makes it
clear that this mode instead utilizes the STARTTLS extension to
upgrade the initial plaintext connection.
Change-Id: I4549ec63735960c619f050a4495935a85dd76ea0
diff --git a/ndncert-mail.conf.sample b/ndncert-mail.conf.sample
index 48e31b1..7731cf5 100644
--- a/ndncert-mail.conf.sample
+++ b/ndncert-mail.conf.sample
@@ -1,7 +1,7 @@
[ndncert.smtp]
SMTP_SERVER = localhost or remote smtp server
SMTP_PORT = port number, usually one from 25 465 587
-ENCRYPT_MODE = select one from ssl/tls/none
+ENCRYPT_MODE = select one from ssl/starttls/none
SMTP_USER = leave it empty if you do not have one
SMTP_PASSWORD = leave it empty if you do not have one
diff --git a/ndncert-send-email-challenge.py b/ndncert-send-email-challenge.py
index 56d8bbe..a220f92 100755
--- a/ndncert-send-email-challenge.py
+++ b/ndncert-send-email-challenge.py
@@ -40,7 +40,7 @@
# connect to SMTP server
if encrypt_mode == 'ssl':
context = smtplib.SMTP_SSL(server, port, timeout=10)
-elif encrypt_mode == 'tls':
+elif encrypt_mode == 'starttls':
context = smtplib.SMTP(server, port, timeout=10)
context.starttls()
elif encrypt_mode == 'none':