@@ -1093,7 +1093,8 @@ static int subscribeToTopic( MQTTContext_t * pMqttContext )
10931093 ( void ) memset ( ( void * ) pGlobalSubscriptionList , 0x00 , sizeof ( pGlobalSubscriptionList ) );
10941094
10951095 /* This example subscribes to only one topic and uses QOS2. */
1096- pGlobalSubscriptionList [ 0 ].qos = MQTTQoS2 ;
1096+ /* AWS IoT Core does not support QoS2. Use QoS1 instead to avoid SSL_read failure. */
1097+ pGlobalSubscriptionList [ 0 ].qos = MQTTQoS1 ;
10971098 pGlobalSubscriptionList [ 0 ].pTopicFilter = MQTT_EXAMPLE_TOPIC ;
10981099 pGlobalSubscriptionList [ 0 ].topicFilterLength = MQTT_EXAMPLE_TOPIC_LENGTH ;
10991100
@@ -1135,8 +1136,9 @@ static int unsubscribeFromTopic( MQTTContext_t * pMqttContext )
11351136 ( void ) memset ( ( void * ) pGlobalSubscriptionList , 0x00 , sizeof ( pGlobalSubscriptionList ) );
11361137
11371138 /* This example subscribes to and unsubscribes from only one topic
1138- * and uses QOS2. */
1139- pGlobalSubscriptionList [ 0 ].qos = MQTTQoS2 ;
1139+ * and uses QOS2. */
1140+ /* AWS IoT Core does not support QoS2. Use QoS1 instead to avoid SSL_read failure. */
1141+ pGlobalSubscriptionList [ 0 ].qos = MQTTQoS1 ;
11401142 pGlobalSubscriptionList [ 0 ].pTopicFilter = MQTT_EXAMPLE_TOPIC ;
11411143 pGlobalSubscriptionList [ 0 ].topicFilterLength = MQTT_EXAMPLE_TOPIC_LENGTH ;
11421144
@@ -1188,7 +1190,8 @@ static int publishToTopic( MQTTContext_t * pMqttContext )
11881190 else
11891191 {
11901192 /* This example publishes to only one topic and uses QOS2. */
1191- outgoingPublishPackets [ publishIndex ].pubInfo .qos = MQTTQoS2 ;
1193+ /* AWS IoT Core does not support QoS2. Use QoS1 instead to avoid SSL_read failure. */
1194+ outgoingPublishPackets [ publishIndex ].pubInfo .qos = MQTTQoS1 ;
11921195 outgoingPublishPackets [ publishIndex ].pubInfo .pTopicName = MQTT_EXAMPLE_TOPIC ;
11931196 outgoingPublishPackets [ publishIndex ].pubInfo .topicNameLength = MQTT_EXAMPLE_TOPIC_LENGTH ;
11941197 outgoingPublishPackets [ publishIndex ].pubInfo .pPayload = MQTT_EXAMPLE_MESSAGE ;
0 commit comments