summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/mbedtls/mbedtls_config_common.h
diff options
context:
space:
mode:
authorKeenan Johnson <keenan.johnson@gmail.com>2025-02-13 13:11:38 -0800
committerDamien George <damien@micropython.org>2025-02-14 12:55:25 +1100
commit321b30ca564bb33c625292247d00f7dd29dc9559 (patch)
tree34f04febf16e5825f069b002494dd512b0c30331 /extmod/mbedtls/mbedtls_config_common.h
parentaef6705a321fbefb06288b5be1f5931bf8c42fe3 (diff)
downloadmicropython-321b30ca564bb33c625292247d00f7dd29dc9559.tar.gz
micropython-321b30ca564bb33c625292247d00f7dd29dc9559.zip
extmod/modtls_mbedtls: Wire in support for DTLS.
This commit enables support for DTLS, i.e. TLS over datagram transport protocols like UDP. While support for DTLS is absent in CPython, it is worth supporting it in MicroPython because it is the basis of the ubiquitous CoAP protocol, used in many IoT projects. To select DTLS, a new set of "protocols" are added to SSLContext: - ssl.PROTOCOL_DTLS_CLIENT - ssl.PROTOCOL_DTLS_SERVER If one of these is set, the library assumes that the underlying socket is a datagram-like socket (i.e. UDP or similar). Our own timer callbacks are implemented because the out of the box implementation relies on `gettimeofday()`. This new DTLS feature is enabled on all ports that use mbedTLS. This commit is an update to a previous PR #10062. Addresses issue #5270 which requested DTLS support. Signed-off-by: Keenan Johnson <keenan.johnson@gmail.com>
Diffstat (limited to 'extmod/mbedtls/mbedtls_config_common.h')
-rw-r--r--extmod/mbedtls/mbedtls_config_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/extmod/mbedtls/mbedtls_config_common.h b/extmod/mbedtls/mbedtls_config_common.h
index 6ea8540af9..6cd14befc3 100644
--- a/extmod/mbedtls/mbedtls_config_common.h
+++ b/extmod/mbedtls/mbedtls_config_common.h
@@ -89,6 +89,7 @@
#define MBEDTLS_SHA384_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_SSL_CLI_C
+#define MBEDTLS_SSL_PROTO_DTLS
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_X509_CRT_PARSE_C