I'm an Stunnel newbie so forgive me if this question has been asked previously. I am using stunnel to accept a connection from http://127.0.0.1:someport/url/to/wsdland connect to hostname.somewhere.abc:443 Everything is working fine with the exception of a certain endpoint that responds with an HTTP status code of 403 "forbidden". What I have determined is that the server is rejecting the request due to the HTTP "Host:" field value, it's set to 127.0.0.1. Is there anyway to pass the value of the config file "connect" property instead (in my case "hostname.somewhere")?I have tried various config settings without success. Config entry: [testnesiis]client = yesaccept = 127.0.0.1:1445connect = testnesiis:443;protocolHost = testnesiis:443protocol = proxy;sni = testnesiis;transparent = both
Thanks and Kudos to the authors of stunnel !
Hi,
As it must be sent by the browser, comes to my mind to set in the hosts file a line like:
127.0.0.1 hostname.somewhere.abc
And replace in stunnel service configuration the connect = hostname.somewhere.abc:443 for connect = IP of hostname.somewhere.abc:443 (hostname.somewhere.abc now points to 127.0.0.1)
Could work unless dynamic IP on hostname.somewhere.abc or shared hosting, that would be a headache.
Or try other ways to spoof Host http header sent by the browser. A proxy is not an option as it preserves it.
Regards.