Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f7e064

Browse files
committed
Issue #22935: Fix test_ssl when the SSLv3 protocol is not supported
1 parent 0041142 commit 3f7e064

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_ssl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,8 @@ def test_protocol_sslv2(self):
21422142
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL)
21432143
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_REQUIRED)
21442144
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False)
2145-
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
2145+
if hasattr(ssl, 'PROTOCOL_SSLv3'):
2146+
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
21462147
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
21472148
# SSLv23 client with specific SSL options
21482149
if no_sslv2_implies_sslv3_hello():

0 commit comments

Comments
 (0)