Skip to content

Commit

Permalink
Merge branch 'trunk' into 8009-rodrigc-cgi-py3
Browse files Browse the repository at this point in the history
  • Loading branch information
markrwilliams authored Mar 20, 2017
2 parents 7d29b61 + 79ae400 commit 65dcb10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/twisted/protocols/test/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def test_disorderlyShutdown(self):

# And when the connection completely dies, check the reason.
def cbDisconnected(clientProtocol):
clientProtocol.lostConnectionReason.trap(Error)
clientProtocol.lostConnectionReason.trap(Error, ConnectionLost)
clientConnectionLost.addCallback(cbDisconnected)
return clientConnectionLost

Expand Down Expand Up @@ -1379,7 +1379,8 @@ def registerProducerAfterConnectionLost(self, streaming):
producer is not used, and its stopProducing method is called.
"""
clientProtocol, tlsProtocol = buildTLSProtocol()
clientProtocol.connectionLost = lambda reason: reason.trap(Error)
clientProtocol.connectionLost = lambda reason: reason.trap(
Error, ConnectionLost)

class Producer(object):
stopped = False
Expand Down
8 changes: 5 additions & 3 deletions src/twisted/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def generateCertificateObjects(organization, organizationalUnit):
@return: a tuple of (key, request, certificate) objects.
"""
pkey = crypto.PKey()
pkey.generate_key(crypto.TYPE_RSA, 512)
pkey.generate_key(crypto.TYPE_RSA, 1024)
req = crypto.X509Req()
subject = req.get_subject()
subject.O = organization
Expand Down Expand Up @@ -668,7 +668,8 @@ def test_method(self):
self.assertEqual(self.context._method, SSL.SSLv23_METHOD)

# And OP_NO_SSLv2 disables the SSLv2 support.
self.assertTrue(self.context._options & SSL.OP_NO_SSLv2)
self.assertEqual(self.context._options & SSL.OP_NO_SSLv2,
SSL.OP_NO_SSLv2)

# Make sure SSLv3 and TLSv1 aren't disabled though.
self.assertFalse(self.context._options & SSL.OP_NO_SSLv3)
Expand Down Expand Up @@ -714,7 +715,8 @@ def test_method(self):
SSLv3 or TLSv1 but not SSLv2.
"""
self.assertEqual(self.context._method, SSL.SSLv23_METHOD)
self.assertTrue(self.context._options & SSL.OP_NO_SSLv2)
self.assertEqual(self.context._options & SSL.OP_NO_SSLv2,
SSL.OP_NO_SSLv2)
self.assertFalse(self.context._options & SSL.OP_NO_SSLv3)
self.assertFalse(self.context._options & SSL.OP_NO_TLSv1)

Expand Down
2 changes: 1 addition & 1 deletion src/twisted/test/test_sslverify.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def counter(counter=itertools.count()):

def makeCertificate(**kw):
keypair = PKey()
keypair.generate_key(TYPE_RSA, 768)
keypair.generate_key(TYPE_RSA, 1024)

certificate = X509()
certificate.gmtime_adj_notBefore(0)
Expand Down
1 change: 1 addition & 0 deletions src/twisted/topfiles/8898.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TLS-related tests now pass when run with OpenSSL 1.1.0. This makes tests pass again on macOS and Windows, as cryptography 1.8 and later include OpenSSL 1.1.0.

0 comments on commit 65dcb10

Please sign in to comment.