From 958f2e5451e7705fe78fef5c857eb4e9923efd98 Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Sat, 18 Jul 2015 05:41:20 +0000 Subject: Implement HTTP Strict Transport Security (HSTS). Input & OK reyk --- usr.sbin/httpd/config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.sbin/httpd/config.c') diff --git a/usr.sbin/httpd/config.c b/usr.sbin/httpd/config.c index 3c889906410..046e63cedfc 100644 --- a/usr.sbin/httpd/config.c +++ b/usr.sbin/httpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.39 2015/07/15 16:00:39 jsing Exp $ */ +/* $OpenBSD: config.c,v 1.40 2015/07/18 05:41:18 florian Exp $ */ /* * Copyright (c) 2011 - 2015 Reyk Floeter @@ -436,6 +436,11 @@ config_getserver_config(struct httpd *env, struct server *srv, goto fail; } + f = SRVFLAG_SERVER_HSTS; + srv_conf->flags |= parent->flags & f; + srv_conf->hsts_max_age = parent->hsts_max_age; + srv_conf->hsts_subdomains = parent->hsts_subdomains; + memcpy(&srv_conf->timeout, &parent->timeout, sizeof(srv_conf->timeout)); srv_conf->maxrequests = parent->maxrequests; -- cgit v1.2.3