diff --git a/subsys/net/lib/sockets/sockets_tls.c b/subsys/net/lib/sockets/sockets_tls.c index a41416678e0..5a985fd562d 100644 --- a/subsys/net/lib/sockets/sockets_tls.c +++ b/subsys/net/lib/sockets/sockets_tls.c @@ -1076,6 +1076,13 @@ static int tls_mbedtls_init(struct tls_context *context, bool is_server) return ret; } + if (context->options.ciphersuites[0] != 0) { + /* Specific ciphersuites configured, so use them */ + NET_DBG("Using user-specified ciphersuites"); + mbedtls_ssl_conf_ciphersuites(&context->config, + context->options.ciphersuites); + } + #if defined(CONFIG_MBEDTLS_SSL_ALPN) if (ALPN_MAX_PROTOCOLS && context->options.alpn_list[0] != NULL) { ret = mbedtls_ssl_conf_alpn_protocols(&context->config, @@ -1198,6 +1205,8 @@ static int tls_opt_ciphersuite_list_set(struct tls_context *context, memcpy(context->options.ciphersuites, optval, optlen); context->options.ciphersuites[cipher_cnt] = 0; + mbedtls_ssl_conf_ciphersuites(&context->config, + context->options.ciphersuites); return 0; }