paho mqtt c 指定tls加密算法安全套件
通过指定enabledCipherSuites字段即可: https://eclipse.dev/paho/files/mqttdoc/MQTTClient/html/struct_m_q_t_t_client___s_s_l_options.html
基本原理:
在 Paho MQTT C 客户端中指定 TLS 算法套件(安全套件),核心是通过 SSL_CTX_set_cipher_list() 接口配置。(enabledCipherSuites 的字符串会原封不动传给 SSL_CTX_set_cipher_list() 接口)
https://github.com/eclipse-paho/paho.mqtt.c/blob/c4381a707a36967708deabb0c55179dd61075eac/src/SSLSocket.c#L661
if (opts->enabledCipherSuites){if ((rc = SSL_CTX_set_cipher_list(net->ctx, opts->enabledCipherSuites)) != 1){if (opts->struct_version >= 3)SSLSocket_error("SSL_CTX_set_cipher_list", NULL, net->socket, rc, opts->ssl_error_cb, opts->ssl_error_context);elseSSLSocket_error("SSL_CTX_set_cipher_list", NULL, net->socket, rc, NULL, NULL);goto free_ctx;}}
https://www.ibm.com/docs/en/clearcase/11.0.0?topic=deploying-tls-ciphers
https://gitee.com/google_5/boringssl/blob/master/ssl/ssl_cipher.cc
https://docs.openssl.org/3.1/man1/openssl-ciphers/
https://docs.openssl.org/3.1/man3/SSL_CTX_set_cipher_list/#name
