HTTP to HTTPS Tunnel

5

2

So the issue is that I have quite a few homebrew scripts/web testing programs that only work with HTTP. The problem is that the website only allows HTTPS connections.

Does anyone know of a way to have like a proxy or something maintain the SSL connection while forwarding the HTTP traffic?

I suppose in essence i kind of need a SSL tunnel?

any ideas?

user53654

Posted 2011-06-24T03:51:44.187

Reputation: 183

If a webpage works on HTTP correctly, it should work just fine with HTTPS as well - HTTPS is just HTTP with an SSL encryption layer. What kind of errors do you get when trying to use the web apps under HTTPS? – Kerri Shotts – 2011-06-24T04:30:11.730

All HTTP is essentially HTTP in an SSL "tunnel." I agree with the earlier comment--you need to clarify what exactly you want to do, and what problems you're having. – Flimzy – 2011-06-24T05:00:10.613

Not sure the above commenters understand what is being asked. He has programs running on his local machine. These scripts were built without support for HTTPS. HTTPS is indeed "just" HTTP with an SSL layer, but that is a big difference in practice and requires that his programs either be written to handle all SSL handshake and session management, OR to do something like what he is asking for. – queso – 2011-06-24T06:55:31.387

Answers

5

Yes. One answer is stunnel. I'll leave it to you to read that guy's nice tutorial, but the gist is that stunnel takes any TCP connection (HTTP on the net uses TCP) and wraps it in an SSL connection, which is exactly what you would need to connect to a sever in the manner you describe.

The linked tutorial is more than you need, but the basics are there for creating a simple single host session.

queso

Posted 2011-06-24T03:51:44.187

Reputation: 752

I don't think this will solve the asker's problem. Tools like stunnel work by having an endpoint on both sides of the connection. In other words, if you have control over both the client and the server, you can install stunnel on both sides and it uses a kind of proprietary HTTP encoding to encode the TCP packets into HTTP packets, so the stunnel on the server-side can decode them. In user53654's case, he only has control of the client. The server can receive his packets and can decrypt them, but has no idea how to decode them into the original HTTP packets as stunnel is not installed there. – Kidburla – 2019-07-18T12:24:03.470

3

Nginx with proxy_pass to https. Try adding below configuration to nginx:

server {
    listen 9000;
    server_name localhost;

    location / {
        proxy_pass https://www.example.com/;
    }
}

And then you can connect via http:// localhost:9000/

Jan Święcki

Posted 2011-06-24T03:51:44.187

Reputation: 131