summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/net_hosted/ssl_verify_callback.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/net_hosted/ssl_verify_callback.py b/tests/net_hosted/ssl_verify_callback.py
index 0dba4e4fd..cd03ff49d 100644
--- a/tests/net_hosted/ssl_verify_callback.py
+++ b/tests/net_hosted/ssl_verify_callback.py
@@ -4,6 +4,12 @@ import io
import socket
import tls
+context = tls.SSLContext(tls.PROTOCOL_TLS_CLIENT)
+
+if not hasattr(context, "verify_callback"):
+ print("SKIP")
+ raise SystemExit
+
def verify_callback(cert, depth):
print("verify_callback:", type(cert), len(cert) > 100, depth)
@@ -16,7 +22,6 @@ def verify_callback_fail(cert, depth):
def test(peer_addr):
- context = tls.SSLContext(tls.PROTOCOL_TLS_CLIENT)
context.verify_mode = tls.CERT_OPTIONAL
context.verify_callback = verify_callback
s = socket.socket()