diff --git a/iothub_client/src/iothub_client_core.c b/iothub_client/src/iothub_client_core.c index 86e77bf955..f0fd65f4bd 100644 --- a/iothub_client/src/iothub_client_core.c +++ b/iothub_client/src/iothub_client_core.c @@ -2682,6 +2682,7 @@ IOTHUB_CLIENT_RESULT IoTHubClientCore_SendMessageDisposition(IOTHUB_CLIENT_CORE_ return result; } + IOTHUB_CLIENT_RESULT IoTHubClientCore_EnablePolicyConfiguration(IOTHUB_CLIENT_CORE_HANDLE iotHubClientHandle, POLICY_CONFIGURATION_TYPE policyType, bool enablePolicyConfiguration) { IOTHUB_CLIENT_RESULT result; diff --git a/iothub_client/src/iothub_client_ll_uploadtoblob.c b/iothub_client/src/iothub_client_ll_uploadtoblob.c index 0114859a1b..ea1f92a1b7 100644 --- a/iothub_client/src/iothub_client_ll_uploadtoblob.c +++ b/iothub_client/src/iothub_client_ll_uploadtoblob.c @@ -707,11 +707,15 @@ IOTHUB_CLIENT_RESULT IoTHubClient_LL_UploadMultipleBlocksToBlob_Impl(IOTHUB_CLIE } else { + // If client is using x509 auth, renegotiation must be turned on in order to work properly. + bool renegotiation_is_on = true; + /*transmit the x509certificate and x509privatekey*/ /*Codes_SRS_IOTHUBCLIENT_LL_02_106: [ - x509certificate and x509privatekey saved options shall be passed on the HTTPAPIEX_SetOption ]*/ if ((upload_data->cred_type == IOTHUB_CREDENTIAL_TYPE_X509 || upload_data->cred_type == IOTHUB_CREDENTIAL_TYPE_X509_ECC) && ((HTTPAPIEX_SetOption(iotHubHttpApiExHandle, OPTION_X509_CERT, upload_data->credentials.x509_credentials.x509certificate) != HTTPAPIEX_OK) || - (HTTPAPIEX_SetOption(iotHubHttpApiExHandle, OPTION_X509_PRIVATE_KEY, upload_data->credentials.x509_credentials.x509privatekey) != HTTPAPIEX_OK)) + (HTTPAPIEX_SetOption(iotHubHttpApiExHandle, OPTION_X509_PRIVATE_KEY, upload_data->credentials.x509_credentials.x509privatekey) != HTTPAPIEX_OK) || + (HTTPAPIEX_SetOption(iotHubHttpApiExHandle, OPTION_SET_TLS_RENEGOTIATION, &renegotiation_is_on) != HTTPAPIEX_OK)) ) { LogError("unable to HTTPAPIEX_SetOption for x509 certificate"); diff --git a/iothub_client/src/iothubtransport_mqtt_common.c b/iothub_client/src/iothubtransport_mqtt_common.c index 8a25a94f61..f17051a70f 100644 --- a/iothub_client/src/iothubtransport_mqtt_common.c +++ b/iothub_client/src/iothubtransport_mqtt_common.c @@ -102,6 +102,7 @@ static const char* REQUEST_ID_PROPERTY = "?$rid="; static const char* DIAGNOSTIC_CONTEXT_CREATION_TIME_UTC_PROPERTY = "creationtimeutc"; static const char* DISTRIBUTED_TRACING_PROPERTY = "tracestate"; + static const char DT_MODEL_ID_TOKEN[] = "model-id"; static const char DEFAULT_IOTHUB_PRODUCT_IDENTIFIER[] = CLIENT_DEVICE_TYPE_PREFIX "/" IOTHUB_SDK_VERSION; diff --git a/iothub_client/tests/iothubclient_ll_u2b_ut/iothub_client_ll_u2b_ut.c b/iothub_client/tests/iothubclient_ll_u2b_ut/iothub_client_ll_u2b_ut.c index e0c100c881..0b6654b68d 100644 --- a/iothub_client/tests/iothubclient_ll_u2b_ut/iothub_client_ll_u2b_ut.c +++ b/iothub_client/tests/iothubclient_ll_u2b_ut/iothub_client_ll_u2b_ut.c @@ -779,6 +779,7 @@ static void setup_upload_blocks_mocks(IOTHUB_CREDENTIAL_TYPE cred_type, bool pro { STRICT_EXPECTED_CALL(HTTPAPIEX_SetOption(IGNORED_PTR_ARG, OPTION_X509_CERT, IGNORED_PTR_ARG)); STRICT_EXPECTED_CALL(HTTPAPIEX_SetOption(IGNORED_PTR_ARG, OPTION_X509_PRIVATE_KEY, IGNORED_PTR_ARG)); + STRICT_EXPECTED_CALL(HTTPAPIEX_SetOption(IGNORED_PTR_ARG, OPTION_SET_TLS_RENEGOTIATION, IGNORED_PTR_ARG)); } if (trusted_cert) { diff --git a/iothub_client/tests/iothubtransport_mqtt_common_ut/iothubtransport_mqtt_common_ut.c b/iothub_client/tests/iothubtransport_mqtt_common_ut/iothubtransport_mqtt_common_ut.c index 0c68062d22..928fd3d18a 100644 --- a/iothub_client/tests/iothubtransport_mqtt_common_ut/iothubtransport_mqtt_common_ut.c +++ b/iothub_client/tests/iothubtransport_mqtt_common_ut/iothubtransport_mqtt_common_ut.c @@ -1086,6 +1086,7 @@ static void setup_message_recv_with_properties_mocks( bool auto_decode, bool msgCbResult) { + setup_message_receive_initial_calls(TEST_MQTT_MSG_TOPIC_W_1_PROP, false); STRICT_EXPECTED_CALL(STRING_c_str(IGNORED_PTR_ARG)).CallCannotFail().SetReturn(TEST_MQTT_MESSAGE_TOPIC); EXPECTED_CALL(STRING_TOKENIZER_create_from_char(TEST_MQTT_MSG_TOPIC_W_1_PROP));