mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-11 16:40:17 +00:00
close connection on bad CA or missing server cert for builtin TLS
This commit is contained in:
1 parent
c77e578a19
commit
65d15bb002
3 files changed
+17
-10
No files matched your search
+3
-4
@@ -132,13 +132,12 @@ static void tcpdrain_fn(struct mg_connection *c, int ev, void *ev_data) {
|
||||
s_drain_conn = c;
|
||||
#if MG_TLS == MG_TLS_BUILTIN
|
||||
if (s_drain_tls) {
|
||||
struct mg_tls_opts opts;
|
||||
struct tls_data *tls;
|
||||
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
mg_tls_init(c, &opts);
|
||||
tls = (struct tls_data *) c->tls;
|
||||
tls = (struct tls_data *) mg_calloc(1, sizeof(*tls));
|
||||
ASSERT(tls != NULL);
|
||||
c->tls = tls;
|
||||
c->is_tls = 1;
|
||||
ASSERT(mg_iobuf_add(&tls->send, 0, data, sizeof(data)) == sizeof(data));
|
||||
} else
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user