mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 13:49:01 +08:00
commit
161edec195
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user