Opened 4 years ago

Closed 4 years ago

#6139 enhancement closed fixed (fixed)

Port twisted.protocols.tls to Python 3

Reported by: itamar Owned by: itamar
Priority: normal Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/tls-py3-6139
branch-diff, diff-cov, branch-cov, buildbot
Author: itamarst


twisted.protocols.tls and twisted.protocols.test.test_tls should run on Python 3.

Change History (7)

comment:1 Changed 4 years ago by itamarst

  • Author set to itamarst
  • Branch set to branches/tls-py3-6139

(In [36209]) Branching to 'tls-py3-6139'

comment:2 Changed 4 years ago by itamarst

(In [36214]) Don't import twisted.internet.ssl until it is ported. Refs #6139

comment:3 Changed 4 years ago by itamarst

(In [36215]) Fix a bug in the loopback port. Refs #6139

comment:4 Changed 4 years ago by itamar

  • Keywords review added
  • Owner changed from itamar to exarkun
  1. I had to manually disable importing of twisted.internet.ssl in a couple of test modules (I didn't check if this is because twisted.protocols.tls is importable or because I installed pyOpenSSL).
  2. We didn't do the loopback port quite right, so I had to fix a bug there.
  3. I re-implemented a couple of context factories, and skipped the one test that actually requires _sslverify. If you want to tell me how to do that easily I can re-enable it as part of this branch.
  4. Other than that, the usual "make the tests pass with extra bees" sort-of-thing.
  5. twisted.internet.test.test_tls will be done separately (and in any case probably depends on other unported modules), there's enough bullet points in here as it is. is started.

comment:5 Changed 4 years ago by exarkun

  • Keywords review removed
  • Owner changed from exarkun to itamar
  1. There are some more unicode strings in test_identityPumpPolicy in
  2. I liked the comments in admin/ Maybe they should annotate the modules being put in almostModules instead, though?
  3. I wonder why twisted/test/ needs changes related to SSL. The tests should already have skipped based on the reactor not providing IReactorSSL. Are we not properly declaring what interfaces the reactor implements?
  4. There's some missing test coverage for twisted.protocols.tls. Can you file a ticket for adding that test coverage?
  5. twisted/internet/test/ should have some notes about switching back to the original context factories once they're ported.

As usual, this code doesn't quite fit in my head. I don't quite understand what the deal with bio_read is here, for example. But the changes don't appear too surprising and the test pass... Please merge after addressing the above points. Thanks.

comment:6 Changed 4 years ago by itamar

  1. Fixed (r36243)
  2. Fixed, and moved a couple more modules into the almostModules list (r36243).
  3. We declare reactor provides IReactorSSL if pyopenssl is importable, we haven't really dealt with case where it imports but Twisted's ssl code is broken.
  4. #6155.
  5. Fixed (r36243).

comment:7 Changed 4 years ago by itamarst

  • Resolution set to fixed
  • Status changed from new to closed

(In [36244]) Merge tls-py3-6139.

Author: itamar Review: exarkun Fixes: #6139

Port twisted.protocols.tls to Python 3.

Note: See TracTickets for help on using tickets.