ERR noise upgrade failed error="no next protocol in HTTP request" #316

Closed
opened 2025-12-29 01:26:47 +01:00 by adam · 3 comments
Owner

Originally created by @rjmalagon on GitHub (Sep 2, 2022).

On v0.17.0-alpha1 , when a linux tailscale 1.30 node try login.

 # Health check:
 #     - not logged in, last login error=register request: Post "https://domain.tld/machine/register": all connection attempts failed > (HTTP: unexpected HTTP response: 301 Moved Permanently, HTTPS: unexpected HTTP response: 400 Bad Request)
 unexpected state: NoState

while the headscale server register this on logs

2022-09-02T16:24:40Z` ERR noise upgrade failed error="no next protocol in HTTP request"
2022/09/02 16:24:40 http: superfluous response.WriteHeader call from github.com/juanfont/headscale.(*Headscale).NoiseUpgradeHandler (noise.go:29)

I got this headscale instance on a podman container (official image), listen on a http port, and exposed to public via a cloudflared reverse proxy

config.yaml extract:

server_url: https://domain.tld:443
listen_addr: 0.0.0.0:8080
Originally created by @rjmalagon on GitHub (Sep 2, 2022). On v0.17.0-alpha1 , when a linux tailscale 1.30 node try login. ``` # Health check: # - not logged in, last login error=register request: Post "https://domain.tld/machine/register": all connection attempts failed > (HTTP: unexpected HTTP response: 301 Moved Permanently, HTTPS: unexpected HTTP response: 400 Bad Request) unexpected state: NoState ``` while the headscale server register this on logs ``` 2022-09-02T16:24:40Z` ERR noise upgrade failed error="no next protocol in HTTP request" 2022/09/02 16:24:40 http: superfluous response.WriteHeader call from github.com/juanfont/headscale.(*Headscale).NoiseUpgradeHandler (noise.go:29) ``` I got this headscale instance on a podman container (official image), listen on a http port, and exposed to public via a cloudflared reverse proxy config.yaml extract: ``` server_url: https://domain.tld:443 listen_addr: 0.0.0.0:8080 ```
adam added the bug label 2025-12-29 01:26:47 +01:00
adam closed this issue 2025-12-29 01:26:47 +01:00
Author
Owner

@juanfont commented on GitHub (Sep 4, 2022):

@rjmalagon this is not a bug in Headscale, but a misconfiguration in your reverse proxy.

Headscale >0.17.x requieres proxying WebSockets to Headscale. Can you take a look to your config and come back to us?

@juanfont commented on GitHub (Sep 4, 2022): @rjmalagon this is not a bug in Headscale, but a misconfiguration in your reverse proxy. Headscale >0.17.x requieres proxying WebSockets to Headscale. Can you take a look to your config and come back to us?
Author
Owner

@rjmalagon commented on GitHub (Sep 5, 2022):

Thanks, I was the useful idiot to illustrate this particular case.
Cloudflare Tunnel reverse proxy does not support update https to wss on same host, and interfere with mTLS client side validation. So no Cloudflare reverse proxy for this.

@rjmalagon commented on GitHub (Sep 5, 2022): Thanks, I was the useful idiot to illustrate this particular case. Cloudflare Tunnel reverse proxy does not support update https to wss on same host, and interfere with mTLS client side validation. So no Cloudflare reverse proxy for this.
Author
Owner

@mannp commented on GitHub (Sep 26, 2022):

Thanks, I was the useful idiot to illustrate this particular case. Cloudflare Tunnel reverse proxy does not support update https to wss on same host, and interfere with mTLS client side validation. So no Cloudflare reverse proxy for this.

Mmh, that is likely my same issue, then :-/ thanks for highlighting it.

@mannp commented on GitHub (Sep 26, 2022): > Thanks, I was the useful idiot to illustrate this particular case. Cloudflare Tunnel reverse proxy does not support update https to wss on same host, and interfere with mTLS client side validation. So no Cloudflare reverse proxy for this. Mmh, that is likely my same issue, then :-/ thanks for highlighting it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#316