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 +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change 44"""
55import os
66
7+ import pytest
8+
79from hyper .compat import ssl
810try :
911 from hyper .ssl_compat import SSLContext
@@ -21,17 +23,21 @@ class TestHyperSSLContext(object):
2123 """
2224 Tests hyper SSLContext
2325 """
26+
27+ @pytest .mark .skipif (
28+ SSLContext is None ,
29+ reason = 'requires PyOpenSSL'
30+ )
2431 def test_custom_context_with_cert_as_file (self ):
2532 # Test using hyper's own SSLContext
26- if SSLContext is not None :
27- context = SSLContext (ssl .PROTOCOL_SSLv23 )
28- context .verify_mode = ssl .CERT_NONE
29- context .check_hostname = False
30-
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- )
33+ context = SSLContext (ssl .PROTOCOL_SSLv23 )
34+ context .verify_mode = ssl .CERT_NONE
35+ context .check_hostname = False
36+
37+ # Test that we can load in a cert and key protected by a passphrase,
38+ # from files.
39+ context .load_cert_chain (
40+ certfile = CLIENT_CERT_FILE ,
41+ keyfile = CLIENT_KEY_FILE ,
42+ password = 'abc123'
43+ )
You can’t perform that action at this time.
0 commit comments