fix built-in TLS not calling MG_EV_TLS_HS; uniformize mg_tls_init()

This commit is contained in:
Sergio R. Caprile
2025-01-27 10:54:56 -03:00
parent e7ea421c54
commit b8b3a5c305
5 changed files with 3 additions and 12 deletions
+1
View File
@@ -31,6 +31,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) {
struct mg_tls_opts opts = {.ca = mg_unpacked("/certs/ca.pem"),
.name = mg_url_host(server)};
mg_tls_init(c, &opts);
mg_tls_handshake(c); // speed up, not strictly necessary
*state = AUTH;
} else if (*state == AUTH) {
char a[100], b[300] = "";