This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Description
func NewInsecure(registryUrl, username, password string) (*Registry, error) {
transport := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
return newFromTransport(registryUrl, username, password, transport, Quiet)
}
Better would be to set some configurations. The way it is at the moment if there is any proxy env. set for example, the proxy will simply be ignored by the registry client.
func NewInsecure(registryUrl, username, password string) (*Registry, error) {
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
return newFromTransport(registryUrl, username, password, transport, Quiet)
}