Skip to content

Commit

Permalink
fix tsh identity output & trusted CA init on login
Browse files Browse the repository at this point in the history
  • Loading branch information
fspmarshall committed Feb 18, 2020
1 parent 9f789ec commit fa0767e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ func (tc *TeleportClient) Login(ctx context.Context, activateKey bool) (*Key, er
key.Cert = response.Cert
key.TLSCert = response.TLSCert
key.ProxyHost = webProxyHost
key.TrustedCA = response.HostSigners

// Check that a host certificate for at least one cluster was returned and
// extract the name of the current cluster from the first host certificate.
Expand Down
4 changes: 2 additions & 2 deletions tool/tsh/tsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func onLogin(cf *CLIConf) {
if profile != nil && !profile.IsExpired(clockwork.NewRealClock()) {
switch {
// in case if nothing is specified, print current status
case cf.Proxy == "" && cf.SiteName == "" && cf.DesiredRoles == "":
case cf.Proxy == "" && cf.SiteName == "" && cf.DesiredRoles == "" && cf.IdentityFileOut == "":
printProfiles(cf.Debug, profile, profiles)
return
// in case if parameters match, print current status
Expand Down Expand Up @@ -447,7 +447,7 @@ func onLogin(cf *CLIConf) {
// proxy is unspecified or the same as the currently provided proxy,
// but desired roles are specified, treat this as a privilege escalation
// request for the same login session.
case (cf.Proxy == "" || host(cf.Proxy) == host(profile.ProxyURL.Host)) && cf.DesiredRoles != "":
case (cf.Proxy == "" || host(cf.Proxy) == host(profile.ProxyURL.Host)) && cf.DesiredRoles != "" && cf.IdentityFileOut == "":
executeAccessRequest(cf)
return
// otherwise just passthrough to standard login
Expand Down

0 comments on commit fa0767e

Please sign in to comment.