mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
set is_tls at mg_listen and mg_connect level
This commit is contained in:
1 parent
29594283c1
commit
b740c80855
25 files changed
+69
-49
No files matched your search
@@ -14,7 +14,7 @@ static const char *s_ca_path = "ca.pem";
|
||||
static void fn(struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_OPEN) {
|
||||
c->is_hexdumping = 1;
|
||||
} else if (ev == MG_EV_CONNECT && mg_url_is_ssl(s_url)) {
|
||||
} else if (c->is_tls && ev == MG_EV_CONNECT) {
|
||||
struct mg_str ca = mg_file_read(&mg_fs_posix, s_ca_path);
|
||||
struct mg_tls_opts opts = {.ca = ca, .name = mg_url_host(s_url)};
|
||||
mg_tls_init(c, &opts);
|
||||
|
||||
Reference in new issue
Block a user