pynetdicom icon indicating copy to clipboard operation
pynetdicom copied to clipboard

No support for TLS v1.3 (with OpenSSL 1.1.1)

Open scaramallion opened this issue 5 years ago • 4 comments

Describe the bug Attempting to associate as the Requestor with SSL/TLS and OpenSSL 1.1.1 causes the association to hang before any data is sent to the peer.

Expected behavior The A-ASSOCIATE-RQ PDU should get sent and the association proceed as normal.

Steps To Reproduce Have OpenSSL 1.1.1 installed and run:

pytest test_transport.py::TestTLS::test_tls_yes_server_yes_client pytest test_transport.py::TestTLS::test_tls_transfer


Update 2020-01-15

Original issue was due to using TLS v1.3. Python support for TLS v1.3 is currently considered "provisional and experimental" and is therefore not supported by pynetdicom. Use TLS v1.2 (or whichever protocol you prefer) instead.

scaramallion avatar Jul 07 '19 04:07 scaramallion

Occurs because AssociationSocket.ready uses select.select() to determine if there's data to be read and for some reason select() is always saying there is, even when there doesn't appear to be?

Works OK on the server socket and with OpenSSL 1.0.1f and 1.1.0g. Might be a python or openssl bug?

scaramallion avatar Jul 07 '19 04:07 scaramallion

With Python 3.8rc1 the two unit tests only fail intermittently instead of always. Progress!

Given they fail intermittently there may be a way to fix this permanently.

scaramallion avatar Oct 05 '19 04:10 scaramallion

Python support for TLS v1.3 is "provisional and experimental". It will also likely require a rewrite of the pynetdicom networking code to use non-blocking IO. Therefore pynetdicom currently only supports TLS up to version 1.2 until Python support for v1.3 stabilises and support for Python 2 ends.

scaramallion avatar Jan 15 '20 00:01 scaramallion

It might be a good time to revisit this issue. Python 3.10 now requires OpenSSL 1.1.1 for the ssl module. As of Python 3.7, it should be possible to discover compatibility using ssl.HAS_TLSv1_3.

blakedewey avatar Jun 01 '22 14:06 blakedewey

Agreed, I've been waiting for it all to mature before looking at it again

scaramallion avatar Nov 07 '23 07:11 scaramallion

I think we're good to go? This was much easier than I was expecting, mostly I think because the required fix(es) had already been spotted and merged earlier.

scaramallion avatar Nov 18 '23 14:11 scaramallion