本文整理汇总了Python中_ssl.PROTOCOL_SSLv2方法的典型用法代码示例。如果您正苦于以下问题:Python _ssl.PROTOCOL_SSLv2方法的具体用法?Python _ssl.PROTOCOL_SSLv2怎么用?Python _ssl.PROTOCOL_SSLv2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_ssl
的用法示例。
在下文中一共展示了_ssl.PROTOCOL_SSLv2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_constants
# 需要导入模块: import _ssl [as 别名]
# 或者: from _ssl import PROTOCOL_SSLv2 [as 别名]
def test_constants(self):
self.assertEqual(real_ssl.CERT_NONE, 0)
self.assertEqual(real_ssl.CERT_OPTIONAL, 1)
self.assertEqual(real_ssl.CERT_REQUIRED, 2)
self.assertEqual(real_ssl.PROTOCOL_SSLv2, 0)
self.assertEqual(real_ssl.PROTOCOL_SSLv23, 2)
self.assertEqual(real_ssl.PROTOCOL_SSLv3, 1)
self.assertEqual(real_ssl.PROTOCOL_TLSv1, 3)
self.assertEqual(real_ssl.PROTOCOL_TLSv1_1, 4)
self.assertEqual(real_ssl.PROTOCOL_TLSv1_2, 5)
self.assertEqual(real_ssl.OP_NO_SSLv2, 0x1000000)
self.assertEqual(real_ssl.OP_NO_SSLv3, 0x2000000)
self.assertEqual(real_ssl.OP_NO_TLSv1, 0x4000000)
self.assertEqual(real_ssl.OP_NO_TLSv1_1, 0x10000000)
self.assertEqual(real_ssl.OP_NO_TLSv1_2, 0x8000000)
self.assertEqual(real_ssl.SSL_ERROR_EOF, 8)
self.assertEqual(real_ssl.SSL_ERROR_INVALID_ERROR_CODE, 9)
self.assertEqual(real_ssl.SSL_ERROR_SSL, 1)
self.assertEqual(real_ssl.SSL_ERROR_SYSCALL, 5)
self.assertEqual(real_ssl.SSL_ERROR_WANT_CONNECT, 7)
self.assertEqual(real_ssl.SSL_ERROR_WANT_READ, 2)
self.assertEqual(real_ssl.SSL_ERROR_WANT_WRITE, 3)
self.assertEqual(real_ssl.SSL_ERROR_WANT_X509_LOOKUP, 4)
self.assertEqual(real_ssl.SSL_ERROR_ZERO_RETURN, 6)
示例2: test_constants
# 需要导入模块: import _ssl [as 别名]
# 或者: from _ssl import PROTOCOL_SSLv2 [as 别名]
def test_constants(self):
self.assertEqual(_ssl.CERT_NONE, 0)
self.assertEqual(_ssl.CERT_OPTIONAL, 1)
self.assertEqual(_ssl.CERT_REQUIRED, 2)
self.assertEqual(_ssl.PROTOCOL_SSLv2, 0)
self.assertEqual(_ssl.PROTOCOL_SSLv23, 2)
self.assertEqual(_ssl.PROTOCOL_SSLv3, 1)
self.assertEqual(_ssl.PROTOCOL_TLSv1, 3)
self.assertEqual(_ssl.PROTOCOL_TLSv1_1, 4)
self.assertEqual(_ssl.PROTOCOL_TLSv1_2, 5)
self.assertEqual(_ssl.OP_NO_SSLv2, 0x1000000)
self.assertEqual(_ssl.OP_NO_SSLv3, 0x2000000)
self.assertEqual(_ssl.OP_NO_TLSv1, 0x4000000)
self.assertEqual(_ssl.OP_NO_TLSv1_1, 0x10000000)
self.assertEqual(_ssl.OP_NO_TLSv1_2, 0x8000000)
self.assertEqual(_ssl.SSL_ERROR_EOF, 8)
self.assertEqual(_ssl.SSL_ERROR_INVALID_ERROR_CODE, 10)
self.assertEqual(_ssl.SSL_ERROR_SSL, 1)
self.assertEqual(_ssl.SSL_ERROR_SYSCALL, 5)
self.assertEqual(_ssl.SSL_ERROR_WANT_CONNECT, 7)
self.assertEqual(_ssl.SSL_ERROR_WANT_READ, 2)
self.assertEqual(_ssl.SSL_ERROR_WANT_WRITE, 3)
self.assertEqual(_ssl.SSL_ERROR_WANT_X509_LOOKUP, 4)
self.assertEqual(_ssl.SSL_ERROR_ZERO_RETURN, 6)