-
Notifications
You must be signed in to change notification settings - Fork 132
HTTP->HTTPS redirection assumes the request contains a host header #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error seem to come from the following line: configurable-http-proxy/bin/configurable-http-proxy Lines 376 to 382 in 5c4d360
My conclusion is that we are assuming that the incoming request will have a host header, but it doesn't, and then it errors like this. |
This is about redirection from HTTP to HTTPS, and HTTPS will require a hostname I think - because certificates are valid for hostnames I think... Focusing on this project, there is room to check for this and provide a better error message, something along the lines of "attempted to redirect to https, but the http request didn't contain a host header, so does it really make sense?". But hmmm, I'm not sure what makes sense to do in this case... @minrk do you have ideas? Hmmm... I figure the assumption that we require a hostname header is wrong, because I figure HTTPS should work without a hostname but instead just using an IP, or? Maybe not? I'm not sure. |
HTTP 1.1 requires a Host header, HTTP 1.0 doesn't (though I didn't think any browsers still used HTTP 1.0!). If you've only got one domain hosted on an IP you don't need a host header since the certificate verification is done on the client side, and the client knows what address it connected to. If you've got multiple virtualhosts the server must support Server Name Indication and the client must send the host so the server knows which certificate to return, if it doesn't the server normally returns a default certificate. |
@manics ❤️! Do you have a suggested course of action? |
Let's check whether the host header is sent or not first- I'm surprised that HTTP 1.0 is being used!
@belavicm would you mind reproducing the bug with the network tab of your browser's development console/tools, and show us the request headers? |
I can't reproduce the bug because my browser is not a problem (using HTTP 1.1). Maybe the problem is with one of the monitoring services (Zabbix, Wazuh, Puppet, etc.)? |
Error description
Jupyterlab and proxy http to https work fine but getting this error.
Log from /var/log/messeges:
Systemctl:
Personal set up
Linux 4.18.0-147.8.1.el8_1.x86_64
CentOS Linux release 8.1.1911 (Core)
jupyterhub 1.1.0
configurable-http-proxy 4.2.1
/etc/jupyterhub/jupyterhub_config.py
The text was updated successfully, but these errors were encountered: