mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
tests/net_hosted/ssl_verify_callback.py: Skip if no verify_callback.
axTLS does not implement the `verify_callback` attribute. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -4,6 +4,12 @@ import io
|
|||||||
import socket
|
import socket
|
||||||
import tls
|
import tls
|
||||||
|
|
||||||
|
context = tls.SSLContext(tls.PROTOCOL_TLS_CLIENT)
|
||||||
|
|
||||||
|
if not hasattr(context, "verify_callback"):
|
||||||
|
print("SKIP")
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
|
|
||||||
def verify_callback(cert, depth):
|
def verify_callback(cert, depth):
|
||||||
print("verify_callback:", type(cert), len(cert) > 100, depth)
|
print("verify_callback:", type(cert), len(cert) > 100, depth)
|
||||||
@@ -16,7 +22,6 @@ def verify_callback_fail(cert, depth):
|
|||||||
|
|
||||||
|
|
||||||
def test(peer_addr):
|
def test(peer_addr):
|
||||||
context = tls.SSLContext(tls.PROTOCOL_TLS_CLIENT)
|
|
||||||
context.verify_mode = tls.CERT_OPTIONAL
|
context.verify_mode = tls.CERT_OPTIONAL
|
||||||
context.verify_callback = verify_callback
|
context.verify_callback = verify_callback
|
||||||
s = socket.socket()
|
s = socket.socket()
|
||||||
|
|||||||
Reference in New Issue
Block a user