micropython/tests/net_inet
Damien George e8a4c1dd53 extmod/modssl: Add SSLContext class.
This commit adds the SSLContext class to the ssl module, and retains the
existing ssl.wrap_socket() function to maintain backwards compatibility.

CPython deprecated the ssl.wrap_socket() function since CPython 3.7 and
instead one should use ssl.SSLContext().wrap_socket().  This commit makes
that possible.

For the axtls implementation:
- ssl.SSLContext is added, although it doesn't hold much state because
  axtls requires calling ssl_ctx_new() for each new socket
- ssl.SSLContext.wrap_socket() is added
- ssl.PROTOCOL_TLS_CLIENT and ssl.PROTOCOL_TLS_SERVER are added

For the mbedtls implementation:
- ssl.SSLContext is added, and holds most of the mbedtls state
- ssl.verify_mode is added (getter and setter)
- ssl.SSLContext.wrap_socket() is added
- ssl.PROTOCOL_TLS_CLIENT and ssl.PROTOCOL_TLS_SERVER are added

The signatures match CPython:
- SSLContext(protocol)
- SSLContext.wrap_socket(sock, *, server_side=False,
    do_handshake_on_connect=True, server_hostname=None)

The existing ssl.wrap_socket() functions retain their existing signature.

Signed-off-by: Damien George <damien@micropython.org>
2023-06-26 16:34:41 +10:00
..
README
asyncio_cancel_stream.py tests: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
asyncio_cancel_stream.py.exp tests: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
asyncio_open_connection.py tests: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
asyncio_open_connection.py.exp tests: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
asyncio_tcp_read_headers.py tests: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
asyncio_tcp_read_headers.py.exp tests: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
getaddrinfo.py
ssl_cert.py
ssl_cert.py.exp
ssl_errors.py
test_tls_nonblock.py
test_tls_sites.py extmod/modssl: Add SSLContext class. 2023-06-26 16:34:41 +10:00
test_tls_sites.py.exp
tls_num_errors.py
tls_num_errors.py.exp
tls_text_errors.py

README

This directory contains network tests which require Internet connection.
Note that these tests are not run as part of the main testsuite and need
to be run separately (from the main test/ directory):

    ./run-tests.py net_inet/*.py