Skip to content

Commit fffdecf

Browse files
committed
fix(proxy): handle host-only server address in addon TLS callback
1 parent 53dcbc9 commit fffdecf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/proxy/addon.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ func (a *SluiceAddon) captureConnectTarget(ctx *mitmproxy.ConnContext) {
287287

288288
host, portStr, err := net.SplitHostPort(addr)
289289
if err != nil {
290-
// Address might be host-only without a port.
291-
log.Printf("[ADDON] failed to parse server address %q: %v", addr, err)
292-
return
290+
// Address might be host-only without a port (e.g. during
291+
// TLS establishment). Default to 443 for TLS connections.
292+
host = addr
293+
portStr = "443"
293294
}
294295

295296
port, err := strconv.Atoi(portStr)

0 commit comments

Comments
 (0)