reyk / httpd

OpenBSD httpd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTPS multiple listen directive problem with FastCGI

brendonm opened this issue · comments

When a server is configured with 2 listen options, one for port 80 and the other for tls port 443, there is a problem with the HTTPS=on flag that goes through FastCGI.

Using the following configuration:

listen on $ext_ip tls port 443
listen on $ext_ip port 80

The HTTPS=on flag is sent through FastCGI regardless of whether you connect to the server via HTTP or HTTPS.

Using the following configuration (reordered from above):

listen on $ext_ip port 80
listen on $ext_ip tls port 443

The HTTPS=on flag is never sent through FastCGI, even if you connect using HTTPS.

I suspect the HTTPS=on flag is being set based on what is first in the configuration instead of the connection type.