From 2ba4a747628282096882be7c2c84d395d0345326 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Fri, 8 Dec 2023 14:41:10 -0300 Subject: [PATCH] update to current API --- examples/zephyr/http-client/src/main.c | 2 +- examples/zephyr/http-server/src/main.c | 2 +- examples/zephyr/mqtt-aws-client/src/main.c | 2 +- examples/zephyr/websocket-server/src/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/zephyr/http-client/src/main.c b/examples/zephyr/http-client/src/main.c index f7c828fb..9f786aac 100644 --- a/examples/zephyr/http-client/src/main.c +++ b/examples/zephyr/http-client/src/main.c @@ -29,7 +29,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { // If s_url is https://, tell client connection to use TLS if (mg_url_is_ssl(s_url)) { - struct mg_tls_opts opts = {.ca = s_ca, .srvname = host}; + struct mg_tls_opts opts = {.ca = s_ca, .name = host}; mg_tls_init(c, &opts); } diff --git a/examples/zephyr/http-server/src/main.c b/examples/zephyr/http-server/src/main.c index 837b87d6..6f250f5a 100644 --- a/examples/zephyr/http-server/src/main.c +++ b/examples/zephyr/http-server/src/main.c @@ -13,7 +13,7 @@ static struct mg_connection *s_sntp_conn = NULL; // Event handler for the listening HTTP/HTTPS connection. static void wcb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { if (ev == MG_EV_ACCEPT && fn_data != NULL) { - struct mg_tls_opts opts = {.cert = s_ssl_cert, .certkey = s_ssl_key}; + struct mg_tls_opts opts = {.cert = s_ssl_cert, .key = s_ssl_key}; mg_tls_init(c, &opts); } else if (ev == MG_EV_HTTP_MSG) { struct mg_http_message *hm = ev_data; diff --git a/examples/zephyr/mqtt-aws-client/src/main.c b/examples/zephyr/mqtt-aws-client/src/main.c index 75bde87a..606b433f 100644 --- a/examples/zephyr/mqtt-aws-client/src/main.c +++ b/examples/zephyr/mqtt-aws-client/src/main.c @@ -24,7 +24,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { MG_ERROR(("%p %s", c->fd, (char *) ev_data)); } else if (ev == MG_EV_CONNECT) { // Set up 2-way TLS that is required by AWS IoT - struct mg_tls_opts opts = {.ca = s_ca, .cert = s_cert, .certkey = s_key}; + struct mg_tls_opts opts = {.ca = s_ca, .cert = s_cert, .key = s_key}; mg_tls_init(c, &opts); } else if (ev == MG_EV_MQTT_OPEN) { // MQTT connect is successful diff --git a/examples/zephyr/websocket-server/src/main.c b/examples/zephyr/websocket-server/src/main.c index 206beba4..ee9aa69c 100644 --- a/examples/zephyr/websocket-server/src/main.c +++ b/examples/zephyr/websocket-server/src/main.c @@ -17,7 +17,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { if (ev == MG_EV_OPEN) { c->is_hexdumping = 1; } else if (ev == MG_EV_ACCEPT && fn_data != NULL) { - struct mg_tls_opts opts = {.cert = s_ssl_cert, .certkey = s_ssl_key}; + struct mg_tls_opts opts = {.cert = s_ssl_cert, .key = s_ssl_key}; mg_tls_init(c, &opts); } else if (ev == MG_EV_HTTP_MSG) { struct mg_http_message *hm = (struct mg_http_message *) ev_data;