tobychui / zoraxy

A general purpose HTTP reverse proxy and forwarding tool. Now written in Go!
https://zoraxy.aroz.org
GNU Affero General Public License v3.0
3.09k stars 187 forks source link

Getting TLS Handshake Error When Accessing the Proxy Host [HELP] #181

Closed vineethmn closed 6 months ago

vineethmn commented 6 months ago

Issue: Getting TLS Handshake Error When Accessing the Proxy Host

I have performed a fresh install of Zoraxy and added a proxy host with the relevant port numbers. I was able to obtain the SSL certificate successfully. However, when I try to access the site, I receive a 404 page not found error. I can confirm that the site is accessible via its IP address.

Logs:

Whenever I hit the URL, I see the following logs from Zoraxy: ls: first record does not look like a TLS handshake

zoraxy  | 2024/05/28 14:03:02 [INFO] Zoraxy started. Visit control panel at http://localhost:8000
zoraxy  | 2024/05/28 14:03:05 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:03:06 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:03:06 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:03:07 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:03:30 [INFO] mDNS Startup scan completed
zoraxy  | 2024/05/28 14:03:35 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:05:08 [Uptime] Uptime monitor config updated
zoraxy  | 2024/05/28 14:05:10 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:05:32 [Uptime] Uptime monitor config updated
zoraxy  | 2024/05/28 14:05:34 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:05:42 [Uptime] Uptime monitor config updated
zoraxy  | 2024/05/28 14:05:50 [Uptime] Uptime monitor config updated
zoraxy  | 2024/05/28 14:06:26 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:06:41 [INFO] Enabling port 80 listener
zoraxy  | 2024/05/28 14:06:41 Starting HTTP-to-HTTPS redirector (port 80)
zoraxy  | 2024/05/28 14:06:41 Reverse proxy service started in the background (TLS mode)
zoraxy  | 2024/05/28 14:06:43 [INFO] Updating force HTTPS redirection to true
zoraxy  | 2024/05/28 14:06:43 HTTP to HTTPS redirection listener stopped
zoraxy  | 2024/05/28 14:06:43 Starting HTTP-to-HTTPS redirector (port 80)
zoraxy  | 2024/05/28 14:06:43 Reverse proxy service started in the background (TLS mode)
zoraxy  | 2024/05/28 14:06:51 Starting HTTP-to-HTTPS redirector (port 80)
zoraxy  | 2024/05/28 14:06:51 Reverse proxy service started in the background (TLS mode)
zoraxy  | 2024/05/28 14:06:51 HTTP to HTTPS redirection listener stopped
zoraxy  | 2024/05/28 14:07:02 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:07:11 tls: first record does not look like a TLS handshake
zoraxy  | 2024/05/28 14:07:11 tls: first record does not look like a TLS handshake

Steps to Performed:

  1. Fresh install of Zoraxy.
  2. Add a proxy host with the relevant port numbers.
  3. Obtain an SSL certificate for the host.
  4. Attempt to access the site via the URL.
  5. Expected Behavior:
  6. The site should be accessible without errors.

Actual Behavior: I receive a 404 page not found error, and the logs show repeated tls: first record does not look like a TLS handshake messages.

image

image

Additional Information:

  1. The site is accessible directly via its IP address.
  2. Zoraxy control panel is accessible at http://localhost:8000.

image

tobychui commented 6 months ago

@vineethmn This seems to be you are connecting to Zoraxy using the wrong protocol. This can be caused by your invalid settings in Zoraxy or wrong network routing config. In short, this errors shows up when you are trying to connect to a HTTPS server using HTTP.

You can refer to a post that have similar issue with Caddy and try to figure out the fixes.

vineethmn commented 6 months ago

Changing host https to http will fix the issue. I mistakenly turned that on in Zoraxy, I thought the TLS checkbox was meant to enable HTTPS access to the URL. I didn't realise this was meant for backend connection.