strict transport security vhost option flag and lwsws conf support
Signed-off-by: Andy Green <andy@warmcat.com>
diff --git a/lwsws/conf.c b/lwsws/conf.c
index 9c2bb06..d032df8 100644
--- a/lwsws/conf.c
+++ b/lwsws/conf.c
@@ -42,6 +42,7 @@
"vhosts[].port",
"vhosts[].interface",
"vhosts[].unix-socket",
+ "vhosts[].sts",
"vhosts[].host-ssl-key",
"vhosts[].host-ssl-cert",
"vhosts[].host-ssl-ca",
@@ -63,6 +64,7 @@
LEJPVP_PORT,
LEJPVP_INTERFACE,
LEJPVP_UNIXSKT,
+ LEJPVP_STS,
LEJPVP_HOST_SSL_KEY,
LEJPVP_HOST_SSL_CERT,
LEJPVP_HOST_SSL_CA,
@@ -190,7 +192,8 @@
"!AES256-SHA256";
a->info->pvo = NULL;
a->info->keepalive_timeout = 60;
- a->info->options &= ~(LWS_SERVER_OPTION_UNIX_SOCK);
+ a->info->options &= ~(LWS_SERVER_OPTION_UNIX_SOCK |
+ LWS_SERVER_OPTION_STS);
}
if (reason == LEJPCB_OBJECT_START &&
@@ -280,6 +283,12 @@
else
a->info->options &= ~(LWS_SERVER_OPTION_UNIX_SOCK);
return 0;
+ case LEJPVP_STS:
+ if (arg_to_bool(ctx->buf))
+ a->info->options |= LWS_SERVER_OPTION_STS;
+ else
+ a->info->options &= ~(LWS_SERVER_OPTION_STS);
+ return 0;
case LEJPVP_HOST_SSL_KEY:
a->info->ssl_private_key_filepath = a->p;
break;