HTTP to HTTPS Tunnel

9,980

Solution 1

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.

Solution 2

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/

Share:
9,980

Related videos on Youtube

user53654
Author by

user53654

Updated on September 18, 2022

Comments

  • user53654
    user53654 over 1 year

    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?

    • jelleklaver
      jelleklaver almost 13 years
      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.
    • queso
      queso almost 13 years
      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.
  • Kidburla
    Kidburla almost 5 years
    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.