From f669cf5e24ea0c8af5c1ef0e00fcf0f1567506f0 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 1 Jun 2026 11:30:29 +0100 Subject: [PATCH] coap_openssl.c: Support clients alternating betweek PKI and PSK --- src/coap_openssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 4c1f9dd2..b205bff1 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -3309,6 +3309,11 @@ coap_dtls_context_set_pki(coap_context_t *ctx, #else /* ! COAP_SERVER_SUPPORT */ (void)role; #endif /* ! COAP_SERVER_SUPPORT */ +#if COAP_CLIENT_SUPPORT + if (role == COAP_DTLS_ROLE_CLIENT) { + context->psk_pki_enabled &= ~IS_PSK; + } +#endif /* COAP_CLIENT_SUPPORT */ if (!context->dtls.ssl) { /* This is set up to handle new incoming sessions to a server */