diff --git a/include/aws/iot/Mqtt5Client.h b/include/aws/iot/Mqtt5Client.h index b78f12822..b523df483 100644 --- a/include/aws/iot/Mqtt5Client.h +++ b/include/aws/iot/Mqtt5Client.h @@ -298,6 +298,15 @@ namespace Aws */ Mqtt5ClientBuilder &WithCertificateAuthority(const Crt::ByteCursor &cert) noexcept; + /** + * Sets the minimum tls version that is acceptable for connection establishment + * + * @param minimumTlsVersion minimum tls version allowed in client connections + * + * @return this builder object + */ + Mqtt5ClientBuilder &WithMinimumTlsVersion(aws_tls_versions minimumTlsVersion) noexcept; + /** * Sets the tls cipher preference for the tls context options. * diff --git a/source/iot/Mqtt5Client.cpp b/source/iot/Mqtt5Client.cpp index 18fde4ec4..fb7691f67 100644 --- a/source/iot/Mqtt5Client.cpp +++ b/source/iot/Mqtt5Client.cpp @@ -346,6 +346,15 @@ namespace Aws return *this; } + Mqtt5ClientBuilder &Mqtt5ClientBuilder::WithMinimumTlsVersion(aws_tls_versions minimumTlsVersion) noexcept + { + if (m_tlsConnectionOptions) + { + m_tlsConnectionOptions->SetMinimumTlsVersion(minimumTlsVersion); + } + return *this; + } + Mqtt5ClientBuilder &Mqtt5ClientBuilder::WithTlsCipherPreference(aws_tls_cipher_pref cipherPref) noexcept { if (m_tlsConnectionOptions)