Skip to content

Commit f1373bd

Browse files
committed
bpo-32008: address review comments
1 parent d76d329 commit f1373bd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Doc/library/ssl.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ purposes.
130130
:meth:`SSLContext.load_verify_locations`. If all three are
131131
:const:`None`, this function can choose to trust the system's default
132132
CA certificates instead.
133+
CA certificates instead.
133134

134135
The settings are: :data:`PROTOCOL_TLS`, :data:`OP_NO_SSLv2`, and
135136
:data:`OP_NO_SSLv3` with high encryption cipher suites without RC4 and
@@ -2226,13 +2227,16 @@ right)::
22262227
certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an
22272228
error and have to adjust the location)
22282229

2230+
The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert
2231+
validation and hostname verification. :attr:`~SSLContext.verify_mode` is
2232+
set to :data:`CERT_REQUIRED` and :attr:`~SSLContext.check_hostname` is set
2233+
to ``True``. All other protocols create SSL contexts with insecure defaults.
2234+
22292235
When you use the context to connect to a server, :const:`CERT_REQUIRED`
2230-
validates the server certificate and :meth:`~SSLContext.check_hostname`
2231-
matches the hostname. Both setting ensure that the server certificate
2232-
was signed with one of the CA certificates and is a valid certificate
2233-
for the given server name. The :data:`PROTOCOL_TLS_CLIENT` protocol
2234-
configures the context for cert and hostname verification. All
2235-
remaining protocols are insecure by default::
2236+
and :attr:`~SSLContext.check_hostname` validate the server certificate: it
2237+
ensures that the server certificate was signed with one of the CA
2238+
certificates, checks the signature for correctness, and verifies other
2239+
properties like validity and identity of the host::
22362240

22372241
>>> conn = context.wrap_socket(socket.socket(socket.AF_INET),
22382242
... server_hostname="www.python.org")

0 commit comments

Comments
 (0)