Twisted #686 changes the behavior of Connection.startTLS to no longer return only on success.
This non-deterministically breaks most of the tests in vertex.test.test_q2q, with secondary AttributeErrors resulting from the following assertion failing:
-
Epsilon/epsilon/juice.py
| old |
new |
|
| 852 | 852 | self.hostCertificate = certificate |
|---|
| 853 | 853 | self._justStartedTLS = True |
|---|
| 854 | 854 | self.transport.startTLS(certificate.options(*verifyAuthorities)) |
|---|
| | 855 | assert self.transport.TLS |
|---|
| 855 | 856 | # Remember that mutable list that we were just talking about? Here |
|---|
| 856 | 857 | # it is. sslverify.py takes care of populating this list as |
|---|
| 857 | 858 | # necessary. --glyph |
This happens even in cases that used to succeed, due to Connection.startTLS no longer attempting an eager inline buffer flush.
The most apparent fix is for Juice.startTLS (and its callers) to wait for Connection.startTLS to complete; i'm not sure how to accomplish this other than defining startTLS to return a Deferred.
For Vertex, this could perhaps be side-stepped by #2580 (AMP).