diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9734715 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,156 @@ +# +# Component Makefile +# + +set (AZURE_IOT_SDK "${CMAKE_CURRENT_LIST_DIR}/azure-iot-sdk-c") + +set (COMPONENT_ADD_INCLUDEDIRS + "port/inc" + "${AZURE_IOT_SDK}/certs" + "${AZURE_IOT_SDK}/c-utility/inc" + "${AZURE_IOT_SDK}/c-utility/deps/azure-macro-utils-c/inc" + "${AZURE_IOT_SDK}/c-utility/deps/umock-c/inc" + "${AZURE_IOT_SDK}/c-utility/pal/inc" + "${AZURE_IOT_SDK}/c-utility/pal/freertos" + "${AZURE_IOT_SDK}/c-utility/pal/generic" + "${AZURE_IOT_SDK}/iothub_client/inc" + "${AZURE_IOT_SDK}/serializer/inc" + "${AZURE_IOT_SDK}/umqtt/inc" + "${AZURE_IOT_SDK}/umqtt/inc/azure_umqtt_c" + "${AZURE_IOT_SDK}/deps/parson" + "${AZURE_IOT_SDK}/deps/umock-c/inc" + "${AZURE_IOT_SDK}/provisioning_client/inc" + "${AZURE_IOT_SDK}/provisioning_client/adapters" + "${AZURE_IOT_SDK}/provisioning_client/deps/utpm/inc" + ) + +set (COMPONENT_SRCS + "port/src/agenttime_esp.c" + "port/src/platform_esp.c" + "port/src/tlsio_esp_tls.c" + "port/src/socketio_esp.c" + "${AZURE_IOT_SDK}/certs/certs.c" # UNUSED + "${AZURE_IOT_SDK}/c-utility/pal/freertos/lock.c" + "${AZURE_IOT_SDK}/c-utility/pal/socket_async.c" + "${AZURE_IOT_SDK}/c-utility/pal/freertos/threadapi.c" + "${AZURE_IOT_SDK}/c-utility/pal/freertos/tickcounter.c" + "${AZURE_IOT_SDK}/c-utility/pal/tlsio_options.c" + "${AZURE_IOT_SDK}/c-utility/src/xlogging.c" + "${AZURE_IOT_SDK}/c-utility/src/singlylinkedlist.c" + "${AZURE_IOT_SDK}/c-utility/src/buffer.c" + "${AZURE_IOT_SDK}/c-utility/src/consolelogger.c" + "${AZURE_IOT_SDK}/c-utility/src/constbuffer.c" + "${AZURE_IOT_SDK}/c-utility/src/constmap.c" + "${AZURE_IOT_SDK}/c-utility/src/crt_abstractions.c" + "${AZURE_IOT_SDK}/c-utility/src/doublylinkedlist.c" + "${AZURE_IOT_SDK}/c-utility/src/gballoc.c" + "${AZURE_IOT_SDK}/c-utility/src/gb_rand.c" + "${AZURE_IOT_SDK}/c-utility/src/gb_stdio.c" + "${AZURE_IOT_SDK}/c-utility/src/gb_time.c" + "${AZURE_IOT_SDK}/c-utility/src/hmac.c" + "${AZURE_IOT_SDK}/c-utility/src/hmacsha256.c" + "${AZURE_IOT_SDK}/c-utility/src/httpapiex.c" + "${AZURE_IOT_SDK}/c-utility/src/httpapiexsas.c" + "${AZURE_IOT_SDK}/c-utility/src/httpheaders.c" + "${AZURE_IOT_SDK}/c-utility/src/map.c" + "${AZURE_IOT_SDK}/c-utility/src/optionhandler.c" + "${AZURE_IOT_SDK}/c-utility/src/sastoken.c" + "${AZURE_IOT_SDK}/c-utility/src/sha1.c" + "${AZURE_IOT_SDK}/c-utility/src/sha224.c" + "${AZURE_IOT_SDK}/c-utility/src/sha384-512.c" + "${AZURE_IOT_SDK}/c-utility/src/strings.c" + "${AZURE_IOT_SDK}/c-utility/src/string_tokenizer.c" + "${AZURE_IOT_SDK}/c-utility/src/urlencode.c" + "${AZURE_IOT_SDK}/c-utility/src/usha.c" + "${AZURE_IOT_SDK}/c-utility/src/utf8_checker.c" + "${AZURE_IOT_SDK}/c-utility/src/vector.c" + "${AZURE_IOT_SDK}/c-utility/src/xio.c" + "${AZURE_IOT_SDK}/c-utility/src/wsio.c" + "${AZURE_IOT_SDK}/c-utility/src/azure_base64.c" + "${AZURE_IOT_SDK}/c-utility/src/uws_frame_encoder.c" + "${AZURE_IOT_SDK}/c-utility/src/uws_client.c" + "${AZURE_IOT_SDK}/c-utility/adapters/httpapi_compact.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_device_client_ll.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_client_ll.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_client_core_ll.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_client_ll_uploadtoblob.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_client_authorization.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_client_retry_control.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_client_diagnostic.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_message.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothubtransport.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothubtransportmqtt.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothubtransport_mqtt_common.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothubtransportmqtt_websockets.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub_transport_ll_private.c" + "${AZURE_IOT_SDK}/iothub_client/src/version.c" + "${AZURE_IOT_SDK}/iothub_client/src/blob.c" + "${AZURE_IOT_SDK}/umqtt/src/mqtt_client.c" + "${AZURE_IOT_SDK}/umqtt/src/mqtt_codec.c" + "${AZURE_IOT_SDK}/umqtt/src/mqtt_message.c" + "${AZURE_IOT_SDK}/deps/parson/parson.c" + "${AZURE_IOT_SDK}/serializer/src/codefirst.c" + "${AZURE_IOT_SDK}/serializer/src/agenttypesystem.c" + "${AZURE_IOT_SDK}/serializer/src/commanddecoder.c" + "${AZURE_IOT_SDK}/serializer/src/datamarshaller.c" + "${AZURE_IOT_SDK}/serializer/src/datapublisher.c" + "${AZURE_IOT_SDK}/serializer/src/dataserializer.c" + "${AZURE_IOT_SDK}/serializer/src/iotdevice.c" + "${AZURE_IOT_SDK}/serializer/src/jsondecoder.c" + "${AZURE_IOT_SDK}/serializer/src/jsonencoder.c" + "${AZURE_IOT_SDK}/serializer/src/methodreturn.c" + "${AZURE_IOT_SDK}/serializer/src/multitree.c" + "${AZURE_IOT_SDK}/serializer/src/schema.c" + "${AZURE_IOT_SDK}/serializer/src/schemalib.c" + "${AZURE_IOT_SDK}/serializer/src/schemaserializer.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_device_client.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_transport_mqtt_client.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_transport_mqtt_common.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_transport_mqtt_ws_client.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_security_factory.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_device_ll_client.c" + "${AZURE_IOT_SDK}/provisioning_client/src/iothub_security_factory.c" + "${AZURE_IOT_SDK}/provisioning_client/src/iothub_auth_client.c" + "${AZURE_IOT_SDK}/provisioning_client/adapters/hsm_client_data.c" + "${AZURE_IOT_SDK}/provisioning_client/adapters/hsm_client_tpm.c" + "${AZURE_IOT_SDK}/provisioning_client/src/prov_auth_client.c" + "${AZURE_IOT_SDK}/provisioning_client/deps/utpm/src/tpm_codec.c" + "${AZURE_IOT_SDK}/provisioning_client/deps/utpm/src/Marshal.c" + "${AZURE_IOT_SDK}/provisioning_client/deps/utpm/src/tpm_comm_emulator.c" + "${AZURE_IOT_SDK}/provisioning_client/deps/utpm/src/Memory.c" + "${AZURE_IOT_SDK}/provisioning_client/deps/utpm/src/tpm_socket_comm.c" + "${AZURE_IOT_SDK}/iothub_client/src/iothub.c" + "${AZURE_IOT_SDK}/c-utility/src/http_proxy_io.c" + "${AZURE_IOT_SDK}/c-utility/src/azure_base32.c" + ) + +set (COMPONENT_SUBMODULES "${AZURE_IOT_SDK}") + +#set(COMPONENT_PRIV_REQUIRES "mbedtls esp-tls main") +set(COMPONENT_PRIV_REQUIRES "mbedtls esp-tls") + +register_component() + +set_source_files_properties( + ${AZURE_IOT_SDK}/iothub_client/src/iothubtransport_mqtt_common.c + PROPERTIES COMPILE_FLAGS + -Wno-maybe-uninitialized +) + +component_compile_options ( + -Wno-unused-function + -Wno-missing-braces + -Wno-missing-field-initializers + -Wno-unknown-pragmas + -Wno-error=format= + -Wno-error=char-subscripts +) + +component_compile_definitions ( + LOGGER_DISABLE_PAL + USE_LWIP_SOCKET_FOR_AZURE_IOT + HSM_TYPE_X509 + HSM_TYPE_SAS_TOKEN + HSM_TYPE_SYMM_KEY + USE_PROV_MODULE +) diff --git a/component.mk b/component.mk index 6a7f8cb..1709535 100644 --- a/component.mk +++ b/component.mk @@ -1,12 +1,13 @@ # # Component Makefile # - + # Component configuration in preprocessor defines CFLAGS += -DUSE_LWIP_SOCKET_FOR_AZURE_IOT COMPONENT_ADD_INCLUDEDIRS := \ azure-iot-sdk-c/c-utility/inc \ +azure-iot-sdk-c/c-utility/inc/azure_c_shared_utility \ azure-iot-sdk-c/c-utility/deps/azure-macro-utils-c/inc \ azure-iot-sdk-c/c-utility/deps/umock-c/inc \ azure-iot-sdk-c/iothub_client/inc \ @@ -14,6 +15,7 @@ azure-iot-sdk-c/serializer/inc \ azure-iot-sdk-c/umqtt/inc \ azure-iot-sdk-c/umqtt/inc/azure_umqtt_c \ azure-iot-sdk-c/deps/parson \ +azure-iot-sdk-c/deps/umock-c/inc \ azure-iot-sdk-c/provisioning_client/inc \ azure-iot-sdk-c/provisioning_client/adapters \ azure-iot-sdk-c/provisioning_client/deps/utpm/inc \ @@ -38,6 +40,7 @@ azure-iot-sdk-c/c-utility/pal/tlsio_options.o \ port/src/agenttime_esp.o \ port/src/platform_esp.o \ port/src/tlsio_esp_tls.o \ +port/src/socketio_esp.o \ \ azure-iot-sdk-c/c-utility/src/xlogging.o \ azure-iot-sdk-c/c-utility/src/singlylinkedlist.o \ @@ -48,6 +51,7 @@ azure-iot-sdk-c/c-utility/src/constmap.o \ azure-iot-sdk-c/c-utility/src/crt_abstractions.o \ azure-iot-sdk-c/c-utility/src/doublylinkedlist.o \ azure-iot-sdk-c/c-utility/src/gballoc.o \ +azure-iot-sdk-c/c-utility/src/gb_rand.o \ azure-iot-sdk-c/c-utility/src/gb_stdio.o \ azure-iot-sdk-c/c-utility/src/gb_time.o \ azure-iot-sdk-c/c-utility/src/hmac.o \ @@ -65,9 +69,14 @@ azure-iot-sdk-c/c-utility/src/strings.o \ azure-iot-sdk-c/c-utility/src/string_tokenizer.o \ azure-iot-sdk-c/c-utility/src/urlencode.o \ azure-iot-sdk-c/c-utility/src/usha.o \ +azure-iot-sdk-c/c-utility/src/utf8_checker.o \ azure-iot-sdk-c/c-utility/src/vector.o \ azure-iot-sdk-c/c-utility/src/xio.o \ +azure-iot-sdk-c/c-utility/src/wsio.o \ azure-iot-sdk-c/c-utility/src/azure_base64.o \ +azure-iot-sdk-c/c-utility/src/uws_frame_encoder.o \ +azure-iot-sdk-c/c-utility/src/uws_client.o \ +azure-iot-sdk-c/c-utility/adapters/httpapi_compact.o \ \ \ azure-iot-sdk-c/iothub_client/src/iothub_device_client_ll.o \ @@ -81,8 +90,10 @@ azure-iot-sdk-c/iothub_client/src/iothub_message.o \ azure-iot-sdk-c/iothub_client/src/iothubtransport.o \ azure-iot-sdk-c/iothub_client/src/iothubtransportmqtt.o \ azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.o \ +azure-iot-sdk-c/iothub_client/src/iothubtransportmqtt_websockets.o \ azure-iot-sdk-c/iothub_client/src/iothub_transport_ll_private.o \ azure-iot-sdk-c/iothub_client/src/version.o \ +azure-iot-sdk-c/iothub_client/src/blob.o \ \ \ azure-iot-sdk-c/umqtt/src/mqtt_client.o \ @@ -111,6 +122,7 @@ azure-iot-sdk-c/serializer/src/schemaserializer.o \ azure-iot-sdk-c/provisioning_client/src/prov_device_client.o \ azure-iot-sdk-c/provisioning_client/src/prov_transport_mqtt_client.o \ azure-iot-sdk-c/provisioning_client/src/prov_transport_mqtt_common.o \ +azure-iot-sdk-c/provisioning_client/src/prov_transport_mqtt_ws_client.o \ azure-iot-sdk-c/provisioning_client/src/prov_security_factory.o \ azure-iot-sdk-c/provisioning_client/src/prov_device_ll_client.o \ azure-iot-sdk-c/provisioning_client/src/iothub_security_factory.o \ @@ -160,7 +172,8 @@ ifndef CONFIG_TARGET_PLATFORM_ESP8266 COMPONENT_SRCDIRS += azure-iot-sdk-c/certs endif -CFLAGS += -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers -DHSM_TYPE_X509 -DHSM_TYPE_SAS_TOKEN -Wno-unknown-pragmas +CFLAGS += -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers -DHSM_TYPE_X509 -DHSM_TYPE_SAS_TOKEN -DHSM_TYPE_SYMM_KEY +CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=char-subscripts -Wno-unknown-pragmas ifdef CONFIG_DEVICE_COMMON_NAME CFLAGS += -DUSE_PROV_MODULE diff --git a/examples/iothub_client_sample_mqtt/main/Kconfig.projbuild b/examples/iothub_client_sample_mqtt/main/Kconfig.projbuild index 1d1bbb9..4e83fb3 100644 --- a/examples/iothub_client_sample_mqtt/main/Kconfig.projbuild +++ b/examples/iothub_client_sample_mqtt/main/Kconfig.projbuild @@ -36,4 +36,10 @@ config MESSAGE_COUNT messages. If the message count is set as 0 then this example will send indefinite messages to the cloud. +config SAMPLE_MQTT_OVER_WEBSOCKET + bool "MQTT over WebSocket" + default n + help + This option enables MQTT over WebSocket protocol, instead of raw MQTT. + endmenu diff --git a/examples/iothub_client_sample_mqtt/main/iothub_client_sample_mqtt.c b/examples/iothub_client_sample_mqtt/main/iothub_client_sample_mqtt.c index e7bb89d..ead18c6 100644 --- a/examples/iothub_client_sample_mqtt/main/iothub_client_sample_mqtt.c +++ b/examples/iothub_client_sample_mqtt/main/iothub_client_sample_mqtt.c @@ -12,12 +12,19 @@ #include "azure_c_shared_utility/crt_abstractions.h" #include "azure_c_shared_utility/platform.h" #include "azure_c_shared_utility/shared_util_options.h" -#include "iothubtransportmqtt.h" #include "iothub_client_options.h" #include "esp_system.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#if CONFIG_SAMPLE_MQTT_OVER_WEBSOCKET + #include "iothubtransportmqtt_websockets.h" + #define PROTOCOL MQTT_WebSocket_Protocol +#else // CONFIG_SAMPLE_MQTT_OVER_WEBSOCKET + #include "iothubtransportmqtt.h" + #define PROTOCOL MQTT_Protocol +#endif // !CONFIG_SAMPLE_MQTT_OVER_WEBSOCKET + #ifdef MBED_BUILD_TIMESTAMP #define SET_TRUSTED_CERT_IN_SAMPLES #endif // MBED_BUILD_TIMESTAMP @@ -148,7 +155,7 @@ void iothub_client_sample_mqtt_run(void) } else { - if ((iotHubClientHandle = IoTHubClient_LL_CreateFromConnectionString(connectionString, MQTT_Protocol)) == NULL) + if ((iotHubClientHandle = IoTHubClient_LL_CreateFromConnectionString(connectionString, PROTOCOL)) == NULL) { (void)printf("ERROR: iotHubClientHandle is NULL!\r\n"); } @@ -157,6 +164,12 @@ void iothub_client_sample_mqtt_run(void) bool traceOn = true; IoTHubClient_LL_SetOption(iotHubClientHandle, OPTION_LOG_TRACE, &traceOn); +#if CONFIG_SAMPLE_MQTT_OVER_WEBSOCKET + // MQTT over WebSocket requires TLS renegociation + bool enable = 1; + IoTHubDeviceClient_LL_SetOption(iotHubClientHandle, OPTION_SET_TLS_RENEGOTIATION, &enable); +#endif // CONFIG_SAMPLE_MQTT_OVER_WEBSOCKET + IoTHubClient_LL_SetConnectionStatusCallback(iotHubClientHandle, connection_status_callback, NULL); // Setting the Trusted Certificate. This is only necessary on system with without // built in certificate stores. diff --git a/port/src/agenttime_esp.c b/port/src/agenttime_esp.c index a9ae6ae..21152d9 100644 --- a/port/src/agenttime_esp.c +++ b/port/src/agenttime_esp.c @@ -12,10 +12,12 @@ void initialize_sntp(void) { - printf("Initializing SNTP\n"); - sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, "pool.ntp.org"); - sntp_init(); + if (!sntp_enabled()) { + printf("Initializing SNTP\n"); + sntp_setoperatingmode(SNTP_OPMODE_POLL); + sntp_setservername(0, "pool.ntp.org"); + sntp_init(); + } } static void obtain_time(void) diff --git a/port/src/socketio_esp.c b/port/src/socketio_esp.c new file mode 100644 index 0000000..4c66e99 --- /dev/null +++ b/port/src/socketio_esp.c @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#include + +#include "azure_c_shared_utility/socketio.h" + +const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void) +{ + return NULL; +} diff --git a/port/src/tlsio_esp_tls.c b/port/src/tlsio_esp_tls.c index 1f5ad37..ec1089e 100644 --- a/port/src/tlsio_esp_tls.c +++ b/port/src/tlsio_esp_tls.c @@ -11,6 +11,7 @@ #include #include #include +#include "esp_log.h" #include "tlsio_pal.h" #include "azure_c_shared_utility/optimize_size.h" #include "azure_c_shared_utility/gballoc.h" @@ -19,7 +20,9 @@ #include "azure_c_shared_utility/singlylinkedlist.h" #include "azure_c_shared_utility/crt_abstractions.h" #include "azure_c_shared_utility/tlsio_options.h" +#include "azure_c_shared_utility/shared_util_options.h" +#include "esp_system.h" #include "esp_tls.h" typedef struct @@ -124,7 +127,11 @@ static void internal_close(TLS_IO_INSTANCE* tls_io_instance) /* Codes_SRS_TLSIO_30_006: [ The phrase "enter TLSIO_STATE_EXT_CLOSED" means the adapter shall forcibly close any existing connections then call the on_io_close_complete function and pass the on_io_close_complete_context that was supplied in tlsio_close_async. ]*/ /* Codes_SRS_TLSIO_30_051: [ On success, if the underlying TLS does not support asynchronous closing, then the adapter shall enter TLSIO_STATE_EXT_CLOSED immediately after entering TLSIO_STATE_EX_CLOSING. ]*/ +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 0, 0)) esp_tls_conn_delete(tls_io_instance->esp_tls_handle); +#else + esp_tls_conn_destroy(tls_io_instance->esp_tls_handle); +#endif while (process_and_destroy_head_message(tls_io_instance, IO_SEND_CANCELLED)); // singlylinkedlist_destroy gets called in the main destroy @@ -216,7 +223,11 @@ static CONCRETE_IO_HANDLE tlsio_esp_tls_create(void* io_create_parameters) result->pending_transmission_list = NULL; tlsio_options_initialize(&result->options, TLSIO_OPTION_BIT_TRUSTED_CERTS | TLSIO_OPTION_BIT_x509_RSA_CERT | TLSIO_OPTION_BIT_x509_ECC_CERT); +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 0, 0)) result->esp_tls_handle = calloc(1, sizeof(esp_tls_t)); +#else + result->esp_tls_handle = esp_tls_init(); +#endif if (result->esp_tls_handle == NULL) { /* Codes_SRS_TLSIO_30_011: [ If any resource allocation fails, tlsio_create shall return NULL. ]*/ @@ -618,17 +629,47 @@ static int tlsio_esp_tls_setoption(CONCRETE_IO_HANDLE tls_io, const char* option else { /* Codes_SRS_TLSIO_30_121: [ If the optionName parameter is NULL, tlsio_esp_tls_setoption shall do nothing except log an error and return FAILURE. ]*/ - /* Codes_SRS_TLSIO_30_122: [ If the value parameter is NULL, tlsio_esp_tls_setoption shall do nothing except log an error and return FAILURE. ]*/ - /* Codes_SRS_TLSIO_ESP_TLS_COMPACT_30_520 [ The tlsio_esp_tls_setoption shall do nothing and return FAILURE. ]*/ - TLSIO_OPTIONS_RESULT options_result = tlsio_options_set(&tls_io_instance->options, optionName, value); - if (options_result != TLSIO_OPTIONS_RESULT_SUCCESS) + if (optionName == NULL) { - LogError("Failed tlsio_options_set"); + LogError("NULL optionName"); result = MU_FAILURE; } else { - result = 0; + /* Codes_SRS_TLSIO_30_122: [ If the value parameter is NULL, tlsio_esp_tls_setoption shall do nothing except log an error and return FAILURE. ]*/ + if (value == NULL) + { + LogError("NULL value"); + result = MU_FAILURE; + } + else + { + if (strcmp(optionName, OPTION_SET_TLS_RENEGOTIATION) == 0) + { + /* esp_tls renegociation should be statically enabled in build config, + menu Component config -> mbedTLS -> Support TLS renegotiation */ +#if CONFIG_MBEDTLS_SSL_RENEGOTIATION + result = 0; +#else + #warning MBEDTLS_SSL_RENEGOTIATION should be enabled in menuconfig + result = MU_FAILURE; +#endif + } + else + { + /* Codes_SRS_TLSIO_ESP_TLS_COMPACT_30_520 [ The tlsio_esp_tls_setoption shall do nothing and return FAILURE. ]*/ + TLSIO_OPTIONS_RESULT options_result = tlsio_options_set(&tls_io_instance->options, optionName, value); + if (options_result != TLSIO_OPTIONS_RESULT_SUCCESS) + { + LogError("Failed tlsio_options_set"); + result = MU_FAILURE; + } + else + { + result = 0; + } + } + } } } return result;