registrytls

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: EPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package registrytls builds TLS and HTTP clients for container registries.

Index

Constants

This section is empty.

Variables

View Source
var ErrHTTPRequiresInsecure = errors.New("http registry urls require insecure=true")

ErrHTTPRequiresInsecure is returned when a registry URL uses http:// without insecure=true.

Functions

func HTTPClient

func HTTPClient(reg *models.Registry) (*http.Client, error)

HTTPClient returns an HTTP client that applies registry ca and insecure.

func TLSConfig

func TLSConfig(reg *models.Registry) (*tls.Config, error)

TLSConfig returns TLS settings for a registry. Extra ca PEM is appended to the system pool (it does not replace system CAs). insecure skips verify.

func Transport

func Transport(reg *models.Registry) (*http.Transport, error)

Transport returns an HTTP transport that applies registry ca and insecure.

Types

type Endpoint

type Endpoint struct {
	// Host is host[:port] with no scheme.
	Host string
	// Scheme is http or https.
	Scheme string
	// PlainHTTP is true when the registry must be contacted over HTTP.
	PlainHTTP bool
}

Endpoint is the HTTP identity of a registry URL.

func Parse

func Parse(reg *models.Registry) (Endpoint, error)

Parse returns the scheme, host, and plain-HTTP flag for a registry URL. http:// requires insecure=true. An empty URL is treated as https with no host.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL