@@ -1269,7 +1269,7 @@ static int s_verify_good_host_mqtt_connect(
1269
1269
AWS_ZERO_STRUCT (client_ctx_options );
1270
1270
aws_tls_ctx_options_set_verify_peer (& client_ctx_options , true);
1271
1271
aws_tls_ctx_options_init_default_client (& client_ctx_options , allocator );
1272
- // aws_tls_ctx_options_set_alpn_list(&client_ctx_options, "mqtt");
1272
+ aws_tls_ctx_options_set_alpn_list (& client_ctx_options , "x-amzn- mqtt-ca " );
1273
1273
1274
1274
if (override_tls_options_fn ) {
1275
1275
(* override_tls_options_fn )(& client_ctx_options );
@@ -1314,7 +1314,7 @@ static int s_verify_good_host_mqtt_connect(
1314
1314
1315
1315
struct aws_byte_cursor host_name_cur = aws_byte_cursor_from_string (host_name );
1316
1316
aws_tls_connection_options_set_server_name (& tls_client_conn_options , allocator , & host_name_cur );
1317
- // aws_tls_connection_options_set_alpn_list(&tls_client_conn_options, allocator, "mqtt");
1317
+ aws_tls_connection_options_set_alpn_list (& tls_client_conn_options , allocator , "x-amzn- mqtt-ca " );
1318
1318
1319
1319
struct aws_socket_options options ;
1320
1320
AWS_ZERO_STRUCT (options );
@@ -1352,18 +1352,18 @@ static int s_verify_good_host_mqtt_connect(
1352
1352
ASSERT_SUCCESS (aws_mutex_unlock (& c_tester .mutex ));
1353
1353
1354
1354
ASSERT_FALSE (outgoing_args .error_invoked );
1355
- // struct aws_byte_buf expected_protocol = aws_byte_buf_from_c_str("http/1.1 ");
1355
+ struct aws_byte_buf expected_protocol = aws_byte_buf_from_c_str ("x-amzn-mqtt-ca " );
1356
1356
/* check ALPN and SNI was properly negotiated */
1357
1357
1358
- /*
1358
+
1359
1359
if (aws_tls_is_alpn_available () && client_ctx_options .verify_peer ) {
1360
1360
ASSERT_BIN_ARRAYS_EQUALS (
1361
1361
expected_protocol .buffer ,
1362
1362
expected_protocol .len ,
1363
1363
outgoing_args .negotiated_protocol .buffer ,
1364
1364
outgoing_args .negotiated_protocol .len );
1365
1365
}
1366
- */
1366
+
1367
1367
1368
1368
// ASSERT_BIN_ARRAYS_EQUALS(
1369
1369
// host_name->bytes, host_name->len, outgoing_args.server_name.buffer, outgoing_args.server_name.len);
@@ -1383,19 +1383,21 @@ static int s_verify_good_host_mqtt_connect(
1383
1383
& c_tester .condition_variable , & c_tester .mutex ,
1384
1384
s_tls_test_read_predicate , & outgoing_rw_args ));
1385
1385
1386
-
1387
1386
ASSERT_SUCCESS (aws_mutex_unlock (& c_tester .mutex ));
1388
1387
1389
- //printf("=====================================printing message received message buffer\n");
1390
- //for (size_t i = 0; i < outgoing_rw_args.received_message.len; i++) {
1391
- // printf(" %.2X ", outgoing_rw_args.received_message.buffer[i]);
1392
- // }
1393
- // printf("\n");
1388
+ aws_mutex_lock (outgoing_rw_args .mutex );
1389
+ printf ("=====================================printing message received message buffer\n" );
1390
+ for (size_t i = 0 ; i < outgoing_rw_args .received_message .len ; i ++ ) {
1391
+ printf (" %.2X " , outgoing_rw_args .received_message .buffer [i ]);
1392
+ }
1393
+ printf ("\n" );
1394
1394
//printf("conn ack is %d\n", outgoing_rw_args.received_message.buffer[3]);
1395
+
1395
1396
ASSERT_INT_EQUALS (0x20 , outgoing_rw_args .received_message .buffer [0 ]); /* conn ack */
1396
1397
ASSERT_INT_EQUALS (0x02 , outgoing_rw_args .received_message .buffer [1 ]); /* conn ack */
1397
1398
ASSERT_INT_EQUALS (0x01 , outgoing_rw_args .received_message .buffer [2 ]); /* conn ack */
1398
1399
ASSERT_INT_EQUALS (0x00 , outgoing_rw_args .received_message .buffer [3 ]); /* conn ack */
1400
+ aws_mutex_unlock (outgoing_rw_args .mutex );
1399
1401
1400
1402
//ASSERT_INT_EQUALS('0', outgoing_rw_args.received_message.buffer[0]); /* conn ack */
1401
1403
//ASSERT_INT_EQUALS('0', outgoing_rw_args.received_message.buffer[1]); /* conn ack */
@@ -1471,7 +1473,8 @@ AWS_STATIC_STRING_FROM_LITERAL(s_aws_ecc384_host_name, "a2yvr5l8sc9814-ats.iot.u
1471
1473
1472
1474
static int s_tls_client_channel_negotiation_success_ecc384_tls1_3_fn (struct aws_allocator * allocator , void * ctx ) {
1473
1475
(void )ctx ;
1474
- return s_verify_good_host_mqtt_connect (allocator , s_aws_ecc384_host_name , 8883 , NULL );
1476
+ //return s_verify_good_host_mqtt_connect(allocator, s_aws_ecc384_host_name, 8883, NULL);
1477
+ return s_verify_good_host_mqtt_connect (allocator , s_aws_ecc384_host_name , 443 , NULL );
1475
1478
}
1476
1479
1477
1480
AWS_TEST_CASE (
0 commit comments