8000 raise an error when STARTTLS fails · stackless-dev/stackless@46b32f3 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 46b32f3

Browse files
committed
raise an error when STARTTLS fails
1 parent 3d4d01f commit 46b32f3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Lib/smtplib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ def starttls(self, keyfile=None, certfile=None, context=None):
695695
self.ehlo_resp = None
696696
self.esmtp_features = {}
697697
self.does_esmtp = 0
698+
else:
699+
# RFC 3207:
700+
# 501 Syntax error (no parameters allowed)
701+
# 454 TLS not available due to temporary reason
702+
raise SMTPResponseException(resp, reply)
698703
return (resp, reply)
699704

700705
def sendmail(self, from_addr, to_addrs, msg, mail_options=[],

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Core and Builtins
1919
Library
2020
-------
2121

22+
- Fix TLS stripping vulnerability in smptlib, CVE-2016-0772. Reported by Team
23+
Oststrom
24+
2225
- Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates.
2326

2427
- Issue #26012: Don't traverse into symlinks for ** pattern in

0 commit comments

Comments
 (0)
0