summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_tls_conf_command.py4
-rw-r--r--test/test_tls_session.py8
2 files changed, 12 insertions, 0 deletions
diff --git a/test/test_tls_conf_command.py b/test/test_tls_conf_command.py
index d48efe64..49df7bf3 100644
--- a/test/test_tls_conf_command.py
+++ b/test/test_tls_conf_command.py
@@ -40,6 +40,10 @@ def test_tls_conf_command():
(_, sock) = client.get_ssl(start=True)
shared_ciphers = sock.shared_ciphers()
+
+ if not shared_ciphers:
+ pytest.skip('no shared ciphers')
+
protocols = list(set(c[1] for c in shared_ciphers))
protocol = sock.cipher()[1]
diff --git a/test/test_tls_session.py b/test/test_tls_session.py
index 5c099fa0..8b2b04fd 100644
--- a/test/test_tls_session.py
+++ b/test/test_tls_session.py
@@ -73,6 +73,10 @@ def connect(ctx=None, session=None):
)
+@pytest.mark.skipif(
+ not hasattr(_lib, 'SSL_session_reused'),
+ reason='session reuse is not supported',
+)
def test_tls_session():
_, sess, ctx, reused = connect()
assert not reused, 'new connection'
@@ -110,6 +114,10 @@ def test_tls_session():
assert False not in [c[-1] for c in conns_again], 'cache big reuse'
+@pytest.mark.skipif(
+ not hasattr(_lib, 'SSL_session_reused'),
+ reason='session reuse is not supported',
+)
def test_tls_session_timeout():
assert 'success' in add_session(cache_size=5, timeout=1)