[stunnel-users] 400 - Bad Request

Pierre DELAAGE delaage.pierre at free.fr
Wed Sep 17 19:59:48 CEST 2014

This is not a matter of "request redirection",
but a matter of "url rewriting":

either you do that at your browser address space, by typing : 

Or you manage that in your web server, provided that you have access, 
eg, to apache conf file:
sometimes rewriting on the server is necessary, but NOT at all in your case.

Anyway : for SSL management on 'http" traffic, stunnel is not at all 
required on the client side (as SSL support is embedded in any browser),
but can be added to the SERVER, if your (eg) apache conf misses all the 
ssl stuff.

BUT....remember that http over SSL is NOT https.

So that, from the server side you have 2 situations :
1/ the web server is HTTP only and YOU added SSL support with stunnel on 
the server side :
here the server will only accept "http://" urls.

2/ the web server is HTTPS, and YOU added (why ?) stunnel on the client 
between a browser and your server :
here the server expects "https:" url ...so give it in your browser.
This seems to be your case


Le 17/09/2014 18:47, j nasty a écrit :
> I'm trying to access a web service endpoint using sTunnel to handle 
> all the SSL traffic. For my other connection setups this works 
> perfectly fine. But for this one particular client I'm getting a 400 - 
> Bad Request Error.
> Client Configuration looks like this:
> /[Connection1]
> client = yes
> accept =
> connect = server.com:443/
> Response I get back is:
> <html><head>
> <title>400 Bad Request</title>
> </head><body>
> <h1>Bad Request</h1>
> <p>Your browser sent a request that this server could not 
> understand.<br />
> Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
> Instead use the HTTPS scheme to access this URL, please.<br />
> <blockquote>Hint: <a 
> href="https://server.com/"><b>https://server.com/</b></a></blockquote></p>
> </body></html>/
> Is there a setting configuration I can use so that sTunnel redirects 
> to https://server.com instead of server.com:443?
> Thanks in advance,
> Jake
> _______________________________________________
> stunnel-users mailing list
> stunnel-users at stunnel.org
> https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stunnel.org/pipermail/stunnel-users/attachments/20140917/dc8409ea/attachment.html>

More information about the stunnel-users mailing list