Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/smtplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,13 @@ def starttls(self, *, context=None):
raise RuntimeError("No SSL support included in this Python")
if context is None:
context = ssl._create_stdlib_context()
if self._host[-1] is ".":
context_host = self._host[:-1]
else:
context_host = self._host
self.sock = context.wrap_socket(self.sock,
server_hostname=self._host)
server_hostname=context_host)

self.file = None
# RFC 3207:
# The client MUST discard any knowledge obtained from
Expand Down
Loading