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 */