summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-08-01 15:12:14 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-08-01 15:12:33 +1000
commit70c564324c9a2af323866b0235dba75f534a9926 (patch)
tree4881e3ece53828f34642cd9089c979b013e432d8
parent01c758e26a846eca42e9c4444639fa822adf005f (diff)
extmod/modssl_mbedtls: Reference SSLContext from SSLSocket.
Prevent the GC cleaning up (and finalising) the SSLContext while the socket is still live. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--extmod/modssl_mbedtls.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/extmod/modssl_mbedtls.c b/extmod/modssl_mbedtls.c
index 83f6f907f..6d78d7d1b 100644
--- a/extmod/modssl_mbedtls.c
+++ b/extmod/modssl_mbedtls.c
@@ -357,6 +357,7 @@ STATIC mp_obj_t ssl_socket_make_new(mp_obj_ssl_context_t *ssl_context, mp_obj_t
mp_obj_ssl_socket_t *o = m_new_obj(mp_obj_ssl_socket_t);
#endif
o->base.type = &ssl_socket_type;
+ o->ssl_context = ssl_context;
o->sock = sock;
o->poll_mask = 0;
o->last_error = 0;