@@ -55,6 +55,30 @@ The :class:`HTTPServer` and :class:`ThreadingHTTPServer` must be given
5555a *RequestHandlerClass * on instantiation, of which this module
5656provides three different variants:
5757
58+ .. class :: HTTPSServer(server_address, RequestHandlerClass, \
59+ bind_and_activate=True, *, certfile, keyfile=None, \
60+ password=None, alpn_protocols=None)
61+
62+ This class is a :class: `HTTPServer ` subclass with a wrapped socket using the
63+ :mod: `ssl `, if the :mod: `ssl ` module is not available the class will not
64+ initialize. The *certfile * argument is required and is the path to the SSL
65+ certificate chain file. The *keyfile * is the path to its private key. But
66+ private keys are often protected and wrapped with PKCS #8, so we provide
67+ *password * argument for that case.
68+
69+ .. versionadded :: 3.14
70+
71+ .. class :: ThreadingHTTPSServer(server_address, RequestHandlerClass, \
72+ bind_and_activate=True, *, certfile, keyfile=None, \
73+ password=None, alpn_protocols=None)
74+
75+ This class is identical to :class: `HTTPSServer ` but uses threads to handle
76+ requests by using the :class: `~socketserver.ThreadingMixIn `. This is
77+ analogue of :class: `ThreadingHTTPServer ` class only using
78+ :class: `HTTPSServer `.
79+
80+ .. versionadded :: 3.14
81+
5882.. class :: BaseHTTPRequestHandler(request, client_address, server)
5983
6084 This class is used to handle the HTTP requests that arrive at the server. By
@@ -462,6 +486,17 @@ following command runs an HTTP/1.1 conformant server::
462486.. versionchanged :: 3.11
463487 Added the ``--protocol `` option.
464488
489+ The server can also support TLS encryption. The options ``--tls-cert `` and
490+ ``--tls-key `` allow specifying a TLS certificate chain and private key for
491+ secure HTTPS connections. And ``--tls-password `` option has been added to
492+ ``http.server `` to support password-protected private keys. For example, the
493+ following command runs the server with TLS enabled::
494+
495+ python -m http.server --tls-cert cert.pem --tls-key key.pem
496+
497+ .. versionchanged :: 3.14
498+ Added the ``--tls-cert ``, ``--tls-key `` and ``--tls-password `` options.
499+
465500.. class :: CGIHTTPRequestHandler(request, client_address, server)
466501
467502 This class is used to serve either files or output of CGI scripts from the
0 commit comments