summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/server.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2017-11-28 01:21:30 +0000
committerbeck <beck@openbsd.org>2017-11-28 01:21:30 +0000
commit5e7d9bbdb994b561a1e02f8f510d76554ec5b4db (patch)
tree495436d23ddfbfaae1b7cd58846ec09dc4994758 /usr.sbin/httpd/server.c
parentrelay_load_fd() is no longer clobering errno in the error case so use (diff)
downloadwireguard-openbsd-5e7d9bbdb994b561a1e02f8f510d76554ec5b4db.tar.xz
wireguard-openbsd-5e7d9bbdb994b561a1e02f8f510d76554ec5b4db.zip
Disable oscp stapling on invalid staple, rather than failing to start.
ok claudio@ florian@
Diffstat (limited to 'usr.sbin/httpd/server.c')
-rw-r--r--usr.sbin/httpd/server.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/httpd/server.c b/usr.sbin/httpd/server.c
index 1a57d0be055..39ebcd0da1d 100644
--- a/usr.sbin/httpd/server.c
+++ b/usr.sbin/httpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.111 2017/08/11 18:48:56 jsing Exp $ */
+/* $OpenBSD: server.c,v 1.112 2017/11/28 01:21:30 beck Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -188,8 +188,18 @@ server_tls_load_ocsp(struct server *srv)
if ((srv->srv_conf.tls_ocsp_staple = tls_load_file(
srv->srv_conf.tls_ocsp_staple_file,
- &srv->srv_conf.tls_ocsp_staple_len, NULL)) == NULL)
- return (-1);
+ &srv->srv_conf.tls_ocsp_staple_len, NULL)) == NULL) {
+ log_warnx("%s: Failed to load ocsp staple from %s - ignoring", __func__,
+ srv->srv_conf.tls_ocsp_staple_file);
+ return (0);
+ }
+
+ if (srv->srv_conf.tls_ocsp_staple_len == 0) {
+ log_warnx("%s: ignoring 0 length ocsp staple from %s", __func__,
+ srv->srv_conf.tls_ocsp_staple_file);
+ return (0);
+ }
+
log_debug("%s: using ocsp staple from %s", __func__,
srv->srv_conf.tls_ocsp_staple_file);