diff --git a/.gitignore b/.gitignore index 8f20918..d602d16 100644 --- a/.gitignore +++ b/.gitignore @@ -103,6 +103,7 @@ screenshots/ .devdata/ test-*.js test-*.sh +!scripts/tests/test-sensor-proxy-http.sh test-*.html *.backup.* .env.dev diff --git a/cmd/pulse-sensor-proxy/http_server.go b/cmd/pulse-sensor-proxy/http_server.go index 834ef89..76585dd 100644 --- a/cmd/pulse-sensor-proxy/http_server.go +++ b/cmd/pulse-sensor-proxy/http_server.go @@ -51,6 +51,10 @@ func (h *HTTPServer) Start() error { MinVersion: tls.VersionTLS12, CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256}, PreferServerCipherSuites: true, + // Force HTTP/1.1 because the Pulse backend HTTP client currently expects classic TLS/HTTP semantics. + // HTTP/2 responses from the proxy caused intermittent hangs/timeouts in the backend client, + // so we explicitly disable ALPN advertising h2 for now. + NextProtos: []string{"http/1.1"}, CipherSuites: []uint16{ tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, @@ -67,6 +71,8 @@ func (h *HTTPServer) Start() error { WriteTimeout: h.config.WriteTimeout, IdleTimeout: 120 * time.Second, MaxHeaderBytes: 1 << 20, // 1 MB + // Disable HTTP/2 upgrade paths until the backend client stack is hardened for it. + TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)), } log.Info(). diff --git a/docs/CONTRIBUTING-SCRIPTS.md b/docs/CONTRIBUTING-SCRIPTS.md index b0d8012..50fe913 100644 --- a/docs/CONTRIBUTING-SCRIPTS.md +++ b/docs/CONTRIBUTING-SCRIPTS.md @@ -23,6 +23,7 @@ ## Testing Checklist - `scripts/tests/run.sh` +- `scripts/tests/test-sensor-proxy-http.sh` (requires Docker; validates uninstall → HTTP install cycle) - Relevant `scripts/tests/integration/*` scripts (add new ones if needed) - Manual `--dry-run` invocation of the script when feasible - Bundle validation: `bash -n dist/