Skip to content

Commit 90d5ad2

Browse files
committed
setup double client id failure test
1 parent b8749c1 commit 90d5ad2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/Mqtt5ClientTest.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,16 @@ static int s_TestMqtt5DoubleClientIDFailure(Aws::Crt::Allocator *allocator, void
15091509
return 0;
15101510
});
15111511

1512+
Aws::Crt::Io::TlsContextOptions tlsCtxOptions = Aws::Crt::Io::TlsContextOptions::InitClientWithMtls(
1513+
mqtt5TestVars.m_certificate_path_string.c_str(), mqtt5TestVars.m_private_key_path_string.c_str(), allocator);
1514+
1515+
Aws::Crt::Io::TlsContext tlsContext(tlsCtxOptions, Aws::Crt::Io::TlsMode::CLIENT, allocator);
1516+
ASSERT_TRUE(tlsContext);
1517+
Aws::Crt::Io::TlsConnectionOptions tlsConnection = tlsContext.NewConnectionOptions();
1518+
ASSERT_TRUE(tlsConnection);
1519+
ASSERT_TRUE(tlsConnection.SetAlpnList("x-amzn-mqtt-ca"));
1520+
mqtt5Options.WithTlsConnectionOptions(tlsConnection);
1521+
15121522
std::shared_ptr<Mqtt5::Mqtt5Client> mqtt5Client1 = Mqtt5::Mqtt5Client::NewMqtt5Client(mqtt5Options, allocator);
15131523
ASSERT_TRUE(mqtt5Client1);
15141524

0 commit comments

Comments
 (0)