diff --git a/tests/extmod/ssl_cadata.py b/tests/extmod/ssl_cadata.py new file mode 100644 index 0000000000..a68cae1ecb --- /dev/null +++ b/tests/extmod/ssl_cadata.py @@ -0,0 +1,14 @@ +# Test ssl.wrap_socket() with cadata passed in. + +try: + import io + import ssl +except ImportError: + print("SKIP") + raise SystemExit + +# Invalid cadata. +try: + ssl.wrap_socket(io.BytesIO(), cadata=b"!") +except ValueError as er: + print(repr(er)) diff --git a/tests/extmod/ssl_cadata.py.exp b/tests/extmod/ssl_cadata.py.exp new file mode 100644 index 0000000000..9f1cf732e3 --- /dev/null +++ b/tests/extmod/ssl_cadata.py.exp @@ -0,0 +1 @@ +ValueError('invalid cert',)