Skip to content

Commit 01ab47f

Browse files
committed
Improve err msg for single-port apps when targetPort != uriPort
1 parent dc532b3 commit 01ab47f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/srv/app/tcpserver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ func ensureZeroTargetPortOrEqualToPortFromURI(uriAddr *utils.NetAddr, targetPort
140140
return nil
141141
}
142142

143-
addrPort := uriAddr.Port(0)
144-
if addrPort == 0 {
143+
uriPort := uriAddr.Port(0)
144+
if uriPort == 0 {
145145
return trace.Errorf("missing or invalid port number in URI %q", uriAddr.String())
146146
}
147147

148-
if targetPort != addrPort {
149-
return trace.BadParameter("target port is not equal to port number from URI (%d vs %d)", targetPort, addrPort)
148+
if targetPort != uriPort {
149+
return trace.BadParameter("attempt to connect to a TCP app with a multi-port cert where the target port from the cert does not match the port from the app URI target_port=%d uri_port=%d", targetPort, uriPort)
150150
}
151151

152152
return nil

0 commit comments

Comments
 (0)