本文整理汇总了Python中tlslite.handshakesettings.HandshakeSettings.maxVersion方法的典型用法代码示例。如果您正苦于以下问题:Python HandshakeSettings.maxVersion方法的具体用法?Python HandshakeSettings.maxVersion怎么用?Python HandshakeSettings.maxVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlslite.handshakesettings.HandshakeSettings
的用法示例。
在下文中一共展示了HandshakeSettings.maxVersion方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_minVersion_higher_than_maxVersion
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import maxVersion [as 别名]
def test_minVersion_higher_than_maxVersion(self):
hs = HandshakeSettings()
hs.minVersion = (3, 3)
hs.maxVersion = (3, 0)
with self.assertRaises(ValueError):
hs.validate()
示例2: test_getTLS13Suites
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import maxVersion [as 别名]
def test_getTLS13Suites(self):
hs = HandshakeSettings()
hs.maxVersion = (3, 4)
self.assertEqual(CipherSuite.getTLS13Suites(hs),
[CipherSuite.TLS_AES_256_GCM_SHA384,
CipherSuite.TLS_AES_128_GCM_SHA256,
CipherSuite.TLS_CHACHA20_POLY1305_SHA256])
示例3: test_maxVersion_without_TLSv1_2
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import maxVersion [as 别名]
def test_maxVersion_without_TLSv1_2(self):
hs = HandshakeSettings()
hs.maxVersion = (3, 2)
self.assertTrue("sha256" in hs.macNames)
new_hs = hs.validate()
self.assertFalse("sha256" in new_hs.macNames)
示例4: test_maxVersion_with_unknown_version
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import maxVersion [as 别名]
def test_maxVersion_with_unknown_version(self):
hs = HandshakeSettings()
hs.maxVersion = (3, 4)
with self.assertRaises(ValueError):
hs.validate()
示例5: test_no_signature_hashes_set_with_TLS1_1
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import maxVersion [as 别名]
def test_no_signature_hashes_set_with_TLS1_1(self):
hs = HandshakeSettings()
hs.rsaSigHashes = []
hs.maxVersion = (3, 2)
self.assertIsNotNone(hs.validate())
示例6: test_getTLS13Suites_with_TLS1_2
# 需要导入模块: from tlslite.handshakesettings import HandshakeSettings [as 别名]
# 或者: from tlslite.handshakesettings.HandshakeSettings import maxVersion [as 别名]
def test_getTLS13Suites_with_TLS1_2(self):
hs = HandshakeSettings()
hs.maxVersion = (3, 4)
self.assertEqual(CipherSuite.getTLS13Suites(hs, (3, 3)),
[])