9aa214077e
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.
8 lines
117 B
Plaintext
8 lines
117 B
Plaintext
wrap_socket: OSError(-256, 'CONN_LOST')
|
|
<_SSLSocket
|
|
4
|
|
b''
|
|
read: OSError(-261,)
|
|
read: OSError(9,)
|
|
write: OSError(9,)
|