Skip to content

Commit 4ee06b3

Browse files
miss-islingtonscop
andauthored
smtplib documentation fixes (GH-8708)
* SMTP.startssl: Fix doc on keyfile and certfile use * SMTP.startssl: Add missing keyfile and certfile deprecation notice * SMTP: Doc grammar fixes (cherry picked from commit da12063) Co-authored-by: Ville Skyttä <[email protected]>
1 parent 4cd33cd commit 4ee06b3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Doc/library/smtplib.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ An :class:`SMTP` instance has the following methods:
271271

272272
.. method:: SMTP.ehlo_or_helo_if_needed()
273273

274-
This method call :meth:`ehlo` and or :meth:`helo` if there has been no
274+
This method calls :meth:`ehlo` and/or :meth:`helo` if there has been no
275275
previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO``
276276
first.
277277

@@ -379,16 +379,23 @@ An :class:`SMTP` instance has the following methods:
379379
commands that follow will be encrypted. You should then call :meth:`ehlo`
380380
again.
381381

382-
If *keyfile* and *certfile* are provided, these are passed to the :mod:`socket`
383-
module's :func:`ssl` function.
382+
If *keyfile* and *certfile* are provided, they are used to create an
383+
:class:`ssl.SSLContext`.
384384

385-
Optional *context* parameter is a :class:`ssl.SSLContext` object; This is
385+
Optional *context* parameter is an :class:`ssl.SSLContext` object; This is
386386
an alternative to using a keyfile and a certfile and if specified both
387387
*keyfile* and *certfile* should be ``None``.
388388

389389
If there has been no previous ``EHLO`` or ``HELO`` command this session,
390390
this method tries ESMTP ``EHLO`` first.
391391

392+
.. deprecated:: 3.6
393+
394+
*keyfile* and *certfile* are deprecated in favor of *context*.
395+
Please use :meth:`ssl.SSLContext.load_cert_chain` instead, or let
396+
:func:`ssl.create_default_context` select the system's trusted CA
397+
certificates for you.
398+
392399
:exc:`SMTPHeloError`
393400
The server didn't reply properly to the ``HELO`` greeting.
394401

0 commit comments

Comments
 (0)