Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cert reissue compatibility #3449

Merged
merged 1 commit into from
Mar 17, 2020
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
8 changes: 1 addition & 7 deletions lib/service/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ type rotationStatus struct {
func checkServerIdentity(conn *Connector, additionalPrincipals []string, dnsNames []string) bool {
var principalsChanged bool
var dnsNamesChanged bool
var oldCertFormat bool

// Remove 0.0.0.0 (meaning advertise_ip has not) if it exists in the list of
// principals. The 0.0.0.0 values tells the auth server to "guess" the nodes
Expand All @@ -628,13 +627,8 @@ func checkServerIdentity(conn *Connector, additionalPrincipals []string, dnsName
log.Debugf("Rotation in progress, adding %v to x590 DNS names in SAN %v.",
dnsNames, conn.ServerIdentity.XCert.DNSNames)
}
// Older certificates did not necessarily include node id in the principal list.
if id, err := conn.ServerIdentity.ID.HostID(); err == nil && !conn.ServerIdentity.HasPrincipals([]string{id}) {
oldCertFormat = true
log.Debugf("Rotation in progress, certificate does not include host id: %s", id)
}

return principalsChanged || dnsNamesChanged || oldCertFormat
return principalsChanged || dnsNamesChanged
}

// rotate is called to check if rotation should be triggered.
Expand Down
4 changes: 4 additions & 0 deletions lib/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,10 @@ func (process *TeleportProcess) getAdditionalPrincipals(role teleport.Role) ([]s
case teleport.RoleAuth, teleport.RoleAdmin:
addrs = process.Config.Auth.PublicAddrs
case teleport.RoleNode:
// DELETE IN 5.0: We are manually adding HostUUID here in order
// to allow UUID based routing to function with older Auth Servers
// which don't automatically add UUID to the principal list.
principals = append(principals, process.Config.HostUUID)
addrs = process.Config.SSH.PublicAddrs
// If advertise IP is set, add it to the list of principals. Otherwise
// add in the default (0.0.0.0) which will be replaced by the Auth Server
Expand Down