7 "github.com/docker/go-connections/tlsconfig"
10 func (s *DefaultService) lookupV2Endpoints(hostname string) (endpoints []APIEndpoint, err error) {
11 tlsConfig := tlsconfig.ServerDefault()
12 if hostname == DefaultNamespace || hostname == IndexHostname {
14 for _, mirror := range s.config.Mirrors {
15 if !strings.HasPrefix(mirror, "http://") && !strings.HasPrefix(mirror, "https://") {
16 mirror = "https://" + mirror
18 mirrorURL, err := url.Parse(mirror)
22 mirrorTLSConfig, err := s.tlsConfigForMirror(mirrorURL)
26 endpoints = append(endpoints, APIEndpoint{
28 // guess mirrors are v2
32 TLSConfig: mirrorTLSConfig,
36 endpoints = append(endpoints, APIEndpoint{
37 URL: DefaultV2Registry,
47 ana := allowNondistributableArtifacts(s.config, hostname)
49 tlsConfig, err = s.tlsConfig(hostname)
54 endpoints = []APIEndpoint{
61 AllowNondistributableArtifacts: ana,
67 if tlsConfig.InsecureSkipVerify {
68 endpoints = append(endpoints, APIEndpoint{
74 AllowNondistributableArtifacts: ana,
76 // used to check if supposed to be secure via InsecureSkipVerify