From: reyk Date: Mon, 4 Aug 2014 18:00:06 +0000 (+0000) Subject: Add HTTPS = on CGI variable. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5e7cd6133d2ca029b7671aadd0347e87fb906673;p=openbsd Add HTTPS = on CGI variable. --- diff --git a/usr.sbin/httpd/config.c b/usr.sbin/httpd/config.c index 35405b8499b..02f2f7133c2 100644 --- a/usr.sbin/httpd/config.c +++ b/usr.sbin/httpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.15 2014/08/04 17:38:12 reyk Exp $ */ +/* $OpenBSD: config.c,v 1.16 2014/08/04 18:00:06 reyk Exp $ */ /* * Copyright (c) 2011 - 2014 Reyk Floeter @@ -266,6 +266,9 @@ config_getserver_config(struct httpd *env, struct server *srv, if ((srv_conf->flags & f) == 0) srv_conf->flags |= srv->srv_conf.flags & f; + f = SRVFLAG_SSL; + srv_conf->flags |= srv->srv_conf.flags & f; + DPRINTF("%s: %s %d location \"%s\", " "parent \"%s\", flags: %s", __func__, ps->ps_title[privsep_process], ps->ps_instance, diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c index a5ba108a67e..1432646b352 100644 --- a/usr.sbin/httpd/server_fcgi.c +++ b/usr.sbin/httpd/server_fcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_fcgi.c,v 1.20 2014/08/04 14:49:24 reyk Exp $ */ +/* $OpenBSD: server_fcgi.c,v 1.21 2014/08/04 18:00:06 reyk Exp $ */ /* * Copyright (c) 2014 Florian Obser @@ -244,6 +244,12 @@ server_fcgi(struct httpd *env, struct client *clt) goto fail; } + if (srv_conf->flags & SRVFLAG_SSL) + if (fcgi_add_param(¶m, "HTTPS", "on", clt) == -1) { + errstr = "failed to encode param"; + goto fail; + } + (void)print_host(&clt->clt_ss, hbuf, sizeof(hbuf)); if (fcgi_add_param(¶m, "REMOTE_ADDR", hbuf, clt) == -1) { errstr = "failed to encode param";