aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-04-26 20:42:21 -0400
committerXe Iaso <me@xeiaso.net>2025-04-26 20:42:21 -0400
commit6aa26b7defa02515fcc8473b8c8603e5fbe45f3f (patch)
tree869fce13da25e00b8a84e74ed936ffed5e5145ee
parent62665656ffc8c20b7913b64dd14f4739bdcf29e7 (diff)
downloadx-6aa26b7defa02515fcc8473b8c8603e5fbe45f3f.tar.xz
x-6aa26b7defa02515fcc8473b8c8603e5fbe45f3f.zip
fix(relayd): disable TCP fingerprinting on Linux for now
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--cmd/relayd/_tcpfingerprint.go (renamed from cmd/relayd/tcpfingerprint.go)2
-rw-r--r--cmd/relayd/fingerprint.go17
-rw-r--r--cmd/relayd/main.go6
3 files changed, 13 insertions, 12 deletions
diff --git a/cmd/relayd/tcpfingerprint.go b/cmd/relayd/_tcpfingerprint.go
index e420354..201a9b6 100644
--- a/cmd/relayd/tcpfingerprint.go
+++ b/cmd/relayd/_tcpfingerprint.go
@@ -1,3 +1,5 @@
+//go:build ignore
+
package main
import (
diff --git a/cmd/relayd/fingerprint.go b/cmd/relayd/fingerprint.go
index 1a30a57..67d55de 100644
--- a/cmd/relayd/fingerprint.go
+++ b/cmd/relayd/fingerprint.go
@@ -7,7 +7,6 @@ import (
"crypto/tls"
"encoding/hex"
"fmt"
- "log/slog"
"net"
"net/http"
"slices"
@@ -42,14 +41,14 @@ func applyTLSFingerprinter(server *http.Server) {
server.ConnContext = func(ctx context.Context, c net.Conn) context.Context {
ctx = context.WithValue(ctx, tlsFingerprintKey{}, &TLSFingerprint{})
- if tc, ok := c.(*tls.Conn); ok {
- tcpFP, err := assignTCPFingerprint(tc.NetConn())
- if err == nil {
- ctx = context.WithValue(ctx, tcpFingerprintKey{}, tcpFP)
- } else {
- slog.Debug("ja4t error", "err", err)
- }
- }
+ // if tc, ok := c.(*tls.Conn); ok {
+ // tcpFP, err := assignTCPFingerprint(tc.NetConn())
+ // if err == nil {
+ // ctx = context.WithValue(ctx, tcpFingerprintKey{}, tcpFP)
+ // } else {
+ // slog.Debug("ja4t error", "err", err)
+ // }
+ // }
return ctx
}
diff --git a/cmd/relayd/main.go b/cmd/relayd/main.go
index 9580fb2..3185b37 100644
--- a/cmd/relayd/main.go
+++ b/cmd/relayd/main.go
@@ -113,9 +113,9 @@ func main() {
}
}
- if tcpFP := GetTCPFingerprint(req); tcpFP != nil {
- req.Header.Set("X-TCP-Fingerprint-JA4T", tcpFP.String())
- }
+ // if tcpFP := GetTCPFingerprint(req); tcpFP != nil {
+ // req.Header.Set("X-TCP-Fingerprint-JA4T", tcpFP.String())
+ // }
req.Header.Set("X-Forwarded-Host", req.URL.Host)
req.Header.Set("X-Forwarded-Proto", "https")