From 51e3a1304b2077512b1dbd373075eb522f7b9022 Mon Sep 17 00:00:00 2001 From: cpq Date: Sat, 13 Feb 2021 10:45:27 +0000 Subject: [PATCH] Fix TLS build --- examples/http-client/Makefile | 4 ++-- examples/http-client/main.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/http-client/Makefile b/examples/http-client/Makefile index 5155a48e..a3a3a1f5 100644 --- a/examples/http-client/Makefile +++ b/examples/http-client/Makefile @@ -2,8 +2,8 @@ PROG ?= example CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA) ifneq ($(MBEDTLS),) -CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS_DIR)/include -I/usr/include -CFLAGS += -L$(MBEDTLS_DIR)/lib -lmbedtls -lmbedcrypto -lmbedx509 +CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include +CFLAGS += -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509 endif ifneq ($(OPENSSL),) diff --git a/examples/http-client/main.c b/examples/http-client/main.c index ab50c4f4..f75c2164 100644 --- a/examples/http-client/main.c +++ b/examples/http-client/main.c @@ -22,8 +22,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 = "ca.pem", .srvname = host}; - struct mg_tls_opts opts = {.ca = "ca.pem", .srvname = mg_str("x")}; + struct mg_tls_opts opts = {.ca = "ca.pem", .srvname = host}; mg_tls_init(c, &opts); }