1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ss: support no tls in policy

If there's no trust store in use, create a default vhost so everything
can continue normally
This commit is contained in:
Andy Green 2020-05-06 15:20:22 +01:00
parent 43b83c333b
commit c3a8387afd

View file

@ -189,6 +189,16 @@ lws_ss_policy_set(struct lws_context *context, const char *name)
if (!pol->trust_store) {
pol = pol->next;
if (!pol && !context->vhost_list) {
/* corner case... there's no trust store used */
i.options = context->options;
i.vhost_name = "_ss_default";
i.port = CONTEXT_PORT_NO_LISTEN;
v = lws_create_vhost(context, &i);
if (!v)
lwsl_err("%s: failed to create vhost %s\n",
__func__, i.vhost_name);
}
continue;
}
v = lws_get_vhost_by_name(context, pol->trust_store->name);