Closed victorlawn closed 2 years ago
Hi Victor! Thank you for your feedback. You are correct and I am currently working on that.
By the way, I already have client/server tests in the test suite (TestCommunication
in tests/test_tls.py
) and I just pushed a couple of PowerShell scripts to make building on Windows easier. You can find them on master under /scripts
. Adding a simple HTML conversation such as the one you posted would be a good idea as well.
Hi Synss, I am wondering if you had any progress this topic, if a fix for this could be available in near time? Or a different question, in your knowledge, is there a prior python-mbedtls release in which both TLS/DTLS are working?
Thanks!
Hi!
‘master’ fixes some problems but the tests still fail in my VM with some Windows error I do not really understand.
I do accept patches, however.
I have not tried that but the WSL would most likely work. Maybe that could be a solution for the time being.
Cheers
I am submitting a …
Description
Setup:
The module was successfully setup, hashing functions proved to be working. It appears that all the functionality is working except TLS. A (D)TLS PSK client and server were setup.
The ClientHello message gets sent but the server fails on do_handshake function. Exception thrown: mbedtls.exceptions.TLSError: TLSError([0x0047] 'NET - Polling the net context failed')
Included .pcap trace: python-mbedtls_rst.zip
Current behavior
Client error traceback:
Traceback (most recent call last): File "...\mbedtls\mbedtls-test.py", line 36, in
block(tls_cli.do_handshake)
File "...\mbedtls\mbedtls-test.py", line 26, in block
return callback(*args, **kwargs)
File "src\mbedtls\tls.pyx", line 1691, in mbedtls.tls.TLSWrappedSocket.do_handshake
File "src\mbedtls\tls.pyx", line 1458, in mbedtls.tls.TLSWrappedBuffer.do_handshake
File "src\mbedtls\tls.pyx", line 1276, in mbedtls.tls._BaseContext._do_handshake
File "src\mbedtls\tls.pyx", line 1281, in mbedtls.tls._BaseContext._do_handshake_step
File "src\mbedtls\tls.pyx", line 1300, in mbedtls.tls._BaseContext._handle_handshake_response
File "src\mbedtls\exceptions.pyx", line 54, in mbedtls.exceptions.check_error
File "src\mbedtls\exceptions.pyx", line 57, in mbedtls.exceptions.check_error
mbedtls.exceptions.TLSError: TLSError([0x0047] 'NET - Polling the net context failed')
Server error traceback:
Traceback (most recent call last): File "...\mbedtls\mbedtls-test-server.py", line 60, in
server_main_loop(tls_srv)
File "...\mbedtls\mbedtls-test-server.py", line 33, in server_main_loop
block(conn.do_handshake)
File "...\mbedtls\mbedtls-test-server.py", line 27, in block
return callback(*args, **kwargs)
File "src\mbedtls\tls.pyx", line 1691, in mbedtls.tls.TLSWrappedSocket.do_handshake
File "src\mbedtls\tls.pyx", line 1458, in mbedtls.tls.TLSWrappedBuffer.do_handshake
File "src\mbedtls\tls.pyx", line 1276, in mbedtls.tls._BaseContext._do_handshake
File "src\mbedtls\tls.pyx", line 1281, in mbedtls.tls._BaseContext._do_handshake_step
File "src\mbedtls\tls.pyx", line 1300, in mbedtls.tls._BaseContext._handle_handshake_response
File "src\mbedtls\exceptions.pyx", line 54, in mbedtls.exceptions.check_error
File "src\mbedtls\exceptions.pyx", line 57, in mbedtls.exceptions.check_error
mbedtls.exceptions.TLSError: TLSError([0x0047] 'NET - Polling the net context failed')
Expected behavior
The handshake should be successful.
Steps to reproduce
Minimal demo of the problem
Server code:
Client code:
Other information