* The `tornado.testing.gen_test` decorator will no longer be recognized
as a (broken) test by ``nose``.
* Work around a bug in Ubuntu 13.04 betas involving an incomplete backport
- of the `ssl.match_hostname` function.
+ of the ``ssl.match_hostname`` function.
* `tornado.websocket.websocket_connect` now fails cleanly when it attempts
to connect to a non-websocket url.
* ``tornado.testing.LogTrapTestCase`` once again works with byte strings
longer supported. (The `ssl` module was updated in version 2.7.9,
although in some distributions the updates are present in builds
with a lower version number. Tornado requires `ssl.SSLContext`,
- `ssl.create_default_context`, and `ssl.match_hostname`)
+ `ssl.create_default_context`, and ``ssl.match_hostname``)
- Versions of Python 3.5 prior to 3.5.2 are no longer supported due to
a change in the async iterator protocol in that version.
- The ``trollius`` project (`asyncio` backported to Python 2) is no
To make this server serve SSL traffic, send the ``ssl_options`` keyword
argument with an `ssl.SSLContext` object. For compatibility with older
versions of Python ``ssl_options`` may also be a dictionary of keyword
- arguments for the `ssl.wrap_socket` method.::
+ arguments for the `ssl.SSLContext.wrap_socket` method.::
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_ctx.load_cert_chain(os.path.join(data_dir, "mydomain.crt"),
The ``ssl_options`` argument may be either an `ssl.SSLContext`
object or a dictionary of keyword arguments for the
- `ssl.wrap_socket` function. The ``server_hostname`` argument
+ `ssl.SSLContext.wrap_socket` function. The ``server_hostname`` argument
will be used for certificate validation unless disabled
in the ``ssl_options``.
If the socket passed to the constructor is already connected,
it should be wrapped with::
- ssl.wrap_socket(sock, do_handshake_on_connect=False, **kwargs)
+ ssl.SSLContext(...).wrap_socket(sock, do_handshake_on_connect=False, **kwargs)
before constructing the `SSLIOStream`. Unconnected sockets will be
wrapped when `IOStream.connect` is finished.
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""The ``ssl_options`` keyword argument may either be an
`ssl.SSLContext` object or a dictionary of keywords arguments
- for `ssl.wrap_socket`
+ for `ssl.SSLContext.wrap_socket`
"""
self._ssl_options = kwargs.pop("ssl_options", _client_ssl_defaults)
super().__init__(*args, **kwargs)
`~ssl.SSLContext` object.
The ``ssl_options`` dictionary contains keywords to be passed to
- `ssl.wrap_socket`. In Python 2.7.9+, `ssl.SSLContext` objects can
+ ``ssl.SSLContext.wrap_socket``. In Python 2.7.9+, `ssl.SSLContext` objects can
be used instead. This function converts the dict form to its
`~ssl.SSLContext` equivalent, and may be used when a component which
accepts both forms needs to upgrade to the `~ssl.SSLContext` version
``ssl_options`` may be either an `ssl.SSLContext` object or a
dictionary (as accepted by `ssl_options_to_context`). Additional
- keyword arguments are passed to ``wrap_socket`` (either the
- `~ssl.SSLContext` method or the `ssl` module function as
- appropriate).
+ keyword arguments are passed to `ssl.SSLContext.wrap_socket`.
.. versionchanged:: 6.2
To make this server serve SSL traffic, send the ``ssl_options`` keyword
argument with an `ssl.SSLContext` object. For compatibility with older
versions of Python ``ssl_options`` may also be a dictionary of keyword
- arguments for the `ssl.wrap_socket` method.::
+ arguments for the `ssl.SSLContext.wrap_socket` method.::
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_ctx.load_cert_chain(os.path.join(data_dir, "mydomain.crt"),