Skip to content
Open
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
7 changes: 7 additions & 0 deletions cli/command/registry/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,15 @@ func runLogin(ctx context.Context, dockerCLI command.Cli, opts loginOptions) err
// if we failed to authenticate with stored credentials (or didn't have stored credentials),
// prompt the user for new credentials
if err != nil || authConfig.Username == "" || authConfig.Password == "" {
msg, err = loginUser(ctx, dockerCLI, opts, authConfig.Username, authConfig.ServerAddress)
msg, err = loginUser(ctx, dockerCLI, opts, authConfig.Username, authConfig.ServerAddress)
if err != nil {
// --- PATCH START: Expose HTTPS to HTTP fallback failures ---
if strings.HasPrefix(opts.serverAddress, "https://") && strings.Contains(err.Error(), "http://") {
return fmt.Errorf("login failed: you requested HTTPS, but the daemon fell back to HTTP (insecure registry) and was rejected.\nDaemon error: %w", err)
}
// --- PATCH END ---

return err
}
}
Expand Down