Example #1
0
 def testFail(self):
     if hasattr(ssl, 'PROTOCOL_TLS'):
         del ssl.PROTOCOL_TLS
     if hasattr(ssl, 'PROTOCOL_TLSv1_2'):
         del ssl.PROTOCOL_TLSv1_2
     with self.assertRaises(serverless_exceptions.NoTLSError):
         connection_context._CheckTLSSupport()
Example #2
0
 def testFailBadSSL(self):
     self.StartObjectPatch(ssl, 'OPENSSL_VERSION', new='OpenSSL 0.9.8zh')
     # Make sure we ask for SSL >1.0
     with self.assertRaisesRegex(serverless_exceptions.NoTLSError,
                                 '>1\\.0'):
         connection_context._CheckTLSSupport()
Example #3
0
 def testSucceed(self):
     ssl.PROTOCOL_TLS = 2
     connection_context._CheckTLSSupport()