aboutsummaryrefslogtreecommitdiff
path: root/tests/extmod/ussl_basic.py.exp
AgeCommit message (Collapse)Author
2020-07-20extmod/modussl: Improve exception error messages.Thorsten von Eicken
This commit adds human readable error messages when mbedtls or axtls raise an exception. Currently often just an EIO error is raised so the user is lost and can't tell whether it's a cert error, buffer overrun, connecting to a non-ssl port, etc. The axtls and mbedtls error raising in the ussl module is modified to raise: OSError(-err_num, "error string") For axtls a small error table of strings is added and used for the second argument of the OSErrer. For mbedtls the code uses mbedtls' built-in strerror function, and if there is an out of memory condition it just produces OSError(-err_num). Producing the error string for mbedtls is conditional on them being included in the mbedtls build, via MBEDTLS_ERROR_C.
2019-04-30tests/ussl_basic: Disable setblocking() calls.Paul Sokolovsky
Now that setblocking() is implemented in modussl_axtls, it calls into the underlying stream object, and io.BytesIO doesn't have setblocking().
2019-04-30extmod/modussl_axtls: Add non-blocking mode support.Paul Sokolovsky
It consists of: 1. "do_handhake" param (default True) to wrap_socket(). If it's False, handshake won't be performed by wrap_socket(), as it would be done in blocking way normally. Instead, SSL socket can be set to non-blocking mode, and handshake would be performed before the first read/write request (by just returning EAGAIN to these requests, while instead reading/writing/ processing handshake over the connection). Unfortunately, axTLS doesn't really support non-blocking handshake correctly. So, while framework for this is implemented on MicroPython's module side, in case of axTLS, it won't work reliably. 2. Implementation of .setblocking() method. It must be called on SSL socket for blocking vs non-blocking operation to be handled correctly (for example, it's not enough to wrap non-blocking socket with wrap_socket() call - resulting SSL socket won't be itself non-blocking). Note that .setblocking() propagates call to the underlying socket object, as expected.
2017-07-20extmod/modussl_axtls: Allow to close ssl stream multiple times.Paul Sokolovsky
Make sure that 2nd close has no effect and operations on closed streams are handled properly.
2017-03-09tests/extmod: Add very basic feature test for ussl module.Damien George
This test just tests that the basic functions/methods can be called with the appropriate arguments. There is no real test of underlying functionality. Thanks to @hosaka for the initial implementation of this test.