Skip to content

Commit

Permalink
Fix of depricated BearSSL method call of WiFiClientSecure class in sa…
Browse files Browse the repository at this point in the history
…mple for ESP8266. (#1780)

* Fix of depricated BearSSL method call in sample for ESP8266.

* Fix of depricated BearSSL method call of WiFiClientSecure class in sample for ESP8266.

Co-authored-by: ts\bozicekm <miha.bozicek@telekom.si>
  • Loading branch information
mikexmas and ts\bozicekm authored Jun 11, 2021
1 parent 0c92d2c commit 11d0bce
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sdk/samples/iot/aziot_esp8266/aziot_esp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static const char* device_key = IOT_CONFIG_DEVICE_KEY;
static const int port = 8883;

static WiFiClientSecure wifi_client;
static X509List cert((const char*)ca_pem);
static PubSubClient mqtt_client(wifi_client);
static az_iot_hub_client client;
static char sas_token[200];
Expand Down Expand Up @@ -107,12 +108,7 @@ void receivedCallback(char* topic, byte* payload, unsigned int length)

static void initializeClients()
{
if (!wifi_client.setCACert((const uint8_t*)ca_pem, ca_pem_len))
{
Serial.println("setCACert() FAILED");
return;
}

wifi_client.setTrustAnchors(&cert);
if (az_result_failed(az_iot_hub_client_init(
&client,
az_span_create((uint8_t*)host, strlen(host)),
Expand Down

0 comments on commit 11d0bce

Please sign in to comment.