docker/cli ยท error

valid https URL required for trust server, got %s

Error message

valid https URL required for trust server, got %s

What it means

Error "valid https URL required for trust server, got %s" thrown in docker/cli.

Source

Thrown at cmd/docker-trust/internal/trust/trust.go:86

// certificateDirectory returns the directory containing
// TLS certificates for the given server. An error is
// returned if there was an error parsing the server string.
func certificateDirectory(server string) (string, error) {
	u, err := url.Parse(server)
	if err != nil {
		return "", err
	}

	return filepath.Join(config.Dir(), "tls", u.Host), nil
}

// Server returns the base URL for the trust server.
func Server(indexName string) (string, error) {
	if s := os.Getenv("DOCKER_CONTENT_TRUST_SERVER"); s != "" {
		urlObj, err := url.Parse(s)
		if err != nil || urlObj.Scheme != "https" {
			return "", fmt.Errorf("valid https URL required for trust server, got %s", s)
		}

		return s, nil
	}
	if indexName == "docker.io" || indexName == "index.docker.io" {
		return NotaryServer, nil
	}
	return "https://" + indexName, nil
}

type simpleCredentialStore struct {
	auth registrytypes.AuthConfig
}

func (scs simpleCredentialStore) Basic(*url.URL) (string, string) {
	return scs.auth.Username, scs.auth.Password
}

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cmd/docker-trust/internal/trust/trust.go:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/a4a4f77a27b0f3b0.json. Report an issue: GitHub.