summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2017-09-06 13:42:30 (GMT)
committerGitHub <noreply@github.com>2017-09-06 13:42:30 (GMT)
commit6da379bde345926e1f7318ead973767f4d791d3e (patch)
tree4083b467312562d9085d53098bf78ea932c48012 /Lib/test/test_ssl.py
parentc3c3062169fad11e0e74aa85ff1f3d69c0170d42 (diff)
downloadcpython-6da379bde345926e1f7318ead973767f4d791d3e.zip
cpython-6da379bde345926e1f7318ead973767f4d791d3e.tar.gz
cpython-6da379bde345926e1f7318ead973767f4d791d3e.tar.bz2
[3.6] bpo-29781: Fix SSLObject.version before handshake (GH-3364) (#3381)
SSLObject.version() now correctly returns None when handshake over BIO has not been performed yet. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 6877111)
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 29d4b40..4191d90 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -1736,6 +1736,7 @@ class SimpleBackgroundTests(unittest.TestCase):
sslobj = ctx.wrap_bio(incoming, outgoing, False, 'localhost')
self.assertIs(sslobj._sslobj.owner, sslobj)
self.assertIsNone(sslobj.cipher())
+ self.assertIsNone(sslobj.version())
self.assertIsNotNone(sslobj.shared_ciphers())
self.assertRaises(ValueError, sslobj.getpeercert)
if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES:
@@ -1743,6 +1744,7 @@ class SimpleBackgroundTests(unittest.TestCase):
self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake)
self.assertTrue(sslobj.cipher())
self.assertIsNotNone(sslobj.shared_ciphers())
+ self.assertIsNotNone(sslobj.version())
self.assertTrue(sslobj.getpeercert())
if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES:
self.assertTrue(sslobj.get_channel_binding('tls-unique'))