0

I'm trying to use Hitch to add https support for one old project with own http server written in C. The Hitch itself is working, but is there any way how to handle, when user try to use http?

E.g. I have the hitch on port 8443.
If I use https:\\1.2.3.4:8443 it works.
But when I write http:\\1.2.3.4:8443 (or just 1.2.3.4:8443) browser doesn't connect.

I know that Hitch is just "dumb" proxy and it doesn't resolve protocols. So is there any way how to achieve this? Or maybe another proxy with similar functionality? I tried also stunnel, but it's the same. I'm using Debian 10.

1
  • I tried to use Nginx instead of Hitch, but it looks like it's not possible. With enabled ssl I'm getting error 400 "The plain HTTP request was sent to HTTPS port " and it never reach the redirection rule. Commented Oct 3, 2023 at 9:47

1 Answer 1

0

Hitch is developed as an independent TLS proxy. However, the primary use case remains TLS termination for Varnish Cache.

If you're looking to proxying both TLS & non-TLS encrypted HTTP traffic, why not use Varnish as your main proxy? While it is specialized in HTTP caching, you're not forced to use the caching part.

You could route all your traffic to Varnish and install Hitch in front of Varnish to tackle the TLS part. You can set the X-Forwarded-Proto header to the right value to make your web server understand whether incoming traffic was originally made via HTTP or HTTPS.

See https://www.varnish-software.com/developers/tutorials/terminate-tls-varnish-hitch/ for a tutorial I made on using Hitch to terminate TLS with Varnish.

If you're looking for a Varnish install guide, go have a look at https://www.varnish-software.com/developers/tutorials/#installations

For Varnish documentation, please see https://varnish-cache.org/docs/index.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.