This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 55import os
66
77from hyper .compat import ssl
8- from hyper .ssl_compat import SSLContext
8+ try :
9+ from hyper .ssl_compat import SSLContext
10+ except ImportError :
11+ SSLContext = None
912
1013
1114TEST_DIR = os .path .abspath (os .path .dirname (__file__ ))
@@ -20,14 +23,15 @@ class TestHyperSSLContext(object):
2023 """
2124 def test_custom_context_with_cert_as_file (self ):
2225 # Test using hyper's own SSLContext
23- context = SSLContext (ssl .PROTOCOL_SSLv23 )
24- context .verify_mode = ssl .CERT_NONE
25- context .check_hostname = False
26+ if SSLContext is not None :
27+ context = SSLContext (ssl .PROTOCOL_SSLv23 )
28+ context .verify_mode = ssl .CERT_NONE
29+ context .check_hostname = False
2630
27- # Test that we can load in a cert and key protected by a passphrase,
28- # from files.
29- context .load_cert_chain (
30- certfile = CLIENT_CERT_FILE ,
31- keyfile = CLIENT_KEY_FILE ,
32- password = 'abc123'
33- )
31+ # Test that we can load in a cert and key protected by a passphrase,
32+ # from files.
33+ context .load_cert_chain (
34+ certfile = CLIENT_CERT_FILE ,
35+ keyfile = CLIENT_KEY_FILE ,
36+ password = 'abc123'
37+ )
You can’t perform that action at this time.
0 commit comments