Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/auth/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ func LocalRegister(id state.IdentityID, authServer *Server, additionalPrincipals
}

// If local registration is happening and no remote address was passed in
// (which means no advertise IP was set), use localhost.
// (which means no advertise IP was set), use localhost. This behavior must
// be kept consistent with the equivalen behavior in cert rotation/re-register
// logic in lib/service.
if remoteAddr == "" {
remoteAddr = defaults.Localhost
}
Expand Down
7 changes: 6 additions & 1 deletion lib/service/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package service

import (
"cmp"
"context"
"crypto/tls"
"errors"
Expand Down Expand Up @@ -406,7 +407,11 @@ func (process *TeleportProcess) reRegister(conn *Connector, additionalPrincipals

if srv := process.getLocalAuth(); srv != nil {
clt = srv
remoteAddr = process.Config.AdvertiseIP
// auth server typically extracts remote addr from conn. since we're using the local auth
// directly we must supply a reasonable remote addr value. preferably the advertise IP, but
// otherwise localhost. this behavior must be kept consistent with the equivalent behavior
// in LocalRegister.
remoteAddr = cmp.Or(process.Config.AdvertiseIP, defaults.Localhost)
}

identity, err := auth.ReRegister(ctx, auth.ReRegisterParams{
Expand Down