Skip to content
Merged
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
10 changes: 6 additions & 4 deletions lib/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"time"

"github.com/gravitational/trace"
"github.com/gravitational/trace/trail"
"github.com/moby/term"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/propagation"
Expand Down Expand Up @@ -514,11 +515,12 @@ func (proxy *ProxyClient) IssueUserCertsWithMFA(ctx context.Context, params Reis
Init: initReq,
}})
if err != nil {
return nil, trace.Wrap(err)
return nil, trace.Wrap(trail.FromGRPC(err))
}

resp, err := stream.Recv()
if err != nil {
err = trail.FromGRPC(err)
// Older versions will NOT reply with a MFARequired response in the
// challenge and will terminate the stream with an auth.ErrNoMFADevices error.
// In this case for all protocols other than SSH fall back to reissuing
Expand Down Expand Up @@ -567,16 +569,16 @@ func (proxy *ProxyClient) IssueUserCertsWithMFA(ctx context.Context, params Reis

mfaResp, err := promptMFAChallenge(ctx, proxy.teleportClient.WebProxyAddr, mfaChal)
if err != nil {
return nil, trace.Wrap(err)
return nil, trace.Wrap(trail.FromGRPC(err))
}
err = stream.Send(&proto.UserSingleUseCertsRequest{Request: &proto.UserSingleUseCertsRequest_MFAResponse{MFAResponse: mfaResp}})
if err != nil {
return nil, trace.Wrap(err)
return nil, trace.Wrap(trail.FromGRPC(err))
}

resp, err = stream.Recv()
if err != nil {
return nil, trace.Wrap(err)
return nil, trace.Wrap(trail.FromGRPC(err))
}
certResp := resp.GetCert()
if certResp == nil {
Expand Down