mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #20913: make it clear that create_default_context() also enables hostname checking
This commit is contained in:
commit
211e6d5908
1 changed files with 5 additions and 4 deletions
|
@ -1626,7 +1626,8 @@ For **client use**, if you don't have any special requirements for your
|
||||||
security policy, it is highly recommended that you use the
|
security policy, it is highly recommended that you use the
|
||||||
:func:`create_default_context` function to create your SSL context.
|
:func:`create_default_context` function to create your SSL context.
|
||||||
It will load the system's trusted CA certificates, enable certificate
|
It will load the system's trusted CA certificates, enable certificate
|
||||||
validation, and try to choose reasonably secure protocol and cipher settings.
|
validation and hostname checking, and try to choose reasonably secure
|
||||||
|
protocol and cipher settings.
|
||||||
|
|
||||||
For example, here is how you would use the :class:`smtplib.SMTP` class to
|
For example, here is how you would use the :class:`smtplib.SMTP` class to
|
||||||
create a trusted, secure connection to a SMTP server::
|
create a trusted, secure connection to a SMTP server::
|
||||||
|
@ -1641,9 +1642,9 @@ If a client certificate is needed for the connection, it can be added with
|
||||||
:meth:`SSLContext.load_cert_chain`.
|
:meth:`SSLContext.load_cert_chain`.
|
||||||
|
|
||||||
By contrast, if you create the SSL context by calling the :class:`SSLContext`
|
By contrast, if you create the SSL context by calling the :class:`SSLContext`
|
||||||
constructor yourself, it will not have certificate validation enabled by
|
constructor yourself, it will not have certificate validation nor hostname
|
||||||
default. If you do so, please read the paragraphs below to achieve a good
|
checking enabled by default. If you do so, please read the paragraphs below
|
||||||
security level.
|
to achieve a good security level.
|
||||||
|
|
||||||
Manual settings
|
Manual settings
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue