mohawk
mohawk copied to clipboard
MACs mismatch when behind ssl proxy server
A common server setup is to have a proxy (such as nginx) in front of the web server that accepts http requests over ssl and proxy passes them to a webserver as http requests.
However, with mohawk, the macs will not match because the port is used to calculate the mac. On the sender end, the port is interpreted as 443 because the request is over https. On the receiving end, behind the proxy, the port is 80 because the request is now over plain http.
My current workaround is to fork mohawk and force port 433 for all url schemes.
Is there a cleaner workaround this issue?
Well, huh. It looks like mohawk defers to how urlparse() gives us the port when parsing the URL.
I'm not sure what the best thing to do here is. You could scour https://github.com/hueniverse/hawk to see if someone else ran into this problem.
My current workaround is to fork mohawk and force port 433 for all url schemes.
It would be nicer if you could specify a port when creating a receiver https://mohawk.readthedocs.io/en/latest/usage.html#receiving-a-request