[issue28124] Rework SSL module documentation

New submission from Christian Heimes: The documentation of the SSL module needs a rework. It's confusing and hard to understand even for experienced developers. The documentation should start with basic use cases and easy-to-reuse best practices. * The module starts with move ssl.wrap_socket() but it's no longer best practice. The section should be moved down and favor of a quick introduction of SSLContext. * ssl.create_default_context() is the best way to create a SSLContext. Mention that purpose flags and that Purpose.SERVER_AUTH is the correct setting on the client side. It means: "Create a context to authenticate the certs of a TLS server." (correct also for ftp, imap, ldap, smtp and so on). * The protocol table is confusing and does not mention the meaning of PROTOCOL_SSLv23 (aka PROTOCOL_TLS). It's auto-negotiation of the highest TLS protocol version and takes OP_NO_* SSLContext.options into account. PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER are the recommended options nowadays. * Don't confront users with CERT_OPTIONAL in the first section. It's a super special mode for client cert authentication on the server side. On the client side, CERT_REQUIRED is the right mode with CERT_NONE as workaround. On the server side CERT_NONE (default) is usually the right setting. * check_hostname is a client-side option that should be enabled all the time. * Explain that users can load the public key of a self-signed certificate like a CA cert to have cert validation even for self-signed certs. ---------- assignee: docs@python components: Documentation messages: 276238 nosy: christian.heimes, docs@python priority: high severity: normal stage: needs patch status: open title: Rework SSL module documentation type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28124> _______________________________________

Changes by Christian Heimes <lists@cheimes.de>: ---------- components: +SSL _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28124> _______________________________________

Change by Christian Heimes <lists@cheimes.de>: ---------- versions: +Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________

Change by Christian Heimes <lists@cheimes.de>: ---------- keywords: +patch pull_requests: +5660 stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________

Christian Heimes <lists@cheimes.de> added the comment: New changeset 90f05a527c7d439f1d0cba80f2eb32e60ee20fc3 by Christian Heimes in branch 'master': bpo-28124: deprecate ssl.wrap_socket() (#5888) https://github.com/python/cpython/commit/90f05a527c7d439f1d0cba80f2eb32e60ee... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +5695 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 102d5204add249248d1a0fa1dd3f673e884b06b4 by Miss Islington (bot) in branch '3.7': bpo-28124: deprecate ssl.wrap_socket() (GH-5888) https://github.com/python/cpython/commit/102d5204add249248d1a0fa1dd3f673e884... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________

Change by Roundup Robot <devnull@psf.upfronthosting.co.za>: ---------- pull_requests: +5731 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________

Cheryl Sabella <cheryl.sabella@gmail.com> added the comment: Can this issue be closed as resolved? It looks like the changes have been merged even though the first PR still has an 'open' status. Thanks! ---------- nosy: +cheryl.sabella _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28124> _______________________________________
participants (4)
-
Cheryl Sabella
-
Christian Heimes
-
miss-islington
-
Roundup Robot