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 4
4
"""
5
5
import os
6
6
7
+ import pytest
8
+
7
9
from hyper .compat import ssl
8
10
try :
9
11
from hyper .ssl_compat import SSLContext
@@ -21,17 +23,21 @@ class TestHyperSSLContext(object):
21
23
"""
22
24
Tests hyper SSLContext
23
25
"""
26
+
27
+ @pytest .mark .skipif (
28
+ SSLContext is None ,
29
+ reason = 'requires PyOpenSSL'
30
+ )
24
31
def test_custom_context_with_cert_as_file (self ):
25
32
# 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