Skip to content

Commit bc098a3

Browse files
committed
python-stdlib/ssl: Add ecdsa_sign_callback callback attribute.
This callback gets invoked to perform ECDSA signing if enabled. See micropython/micropython#15905 Signed-off-by: iabdalkader <[email protected]>
1 parent 50ed36f commit bc098a3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python-stdlib/ssl/ssl.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class SSLContext:
66
def __init__(self, *args):
77
self._context = tls.SSLContext(*args)
88
self._context.verify_mode = CERT_NONE
9+
self._context.ecdsa_sign_callback = None
910

1011
@property
1112
def verify_mode(self):
@@ -15,6 +16,14 @@ def verify_mode(self):
1516
def verify_mode(self, val):
1617
self._context.verify_mode = val
1718

19+
@property
20+
def ecdsa_sign_callback(self):
21+
return self._context.ecdsa_sign_callback
22+
23+
@ecdsa_sign_callback.setter
24+
def ecdsa_sign_callback(self, val):
25+
self._context.ecdsa_sign_callback = val
26+
1827
def load_cert_chain(self, certfile, keyfile):
1928
if isinstance(certfile, str):
2029
with open(certfile, "rb") as f:

0 commit comments

Comments
 (0)