Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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