Skip to content

Commit

Permalink
fix: proxy env with insecure enabled is not respected
Browse files Browse the repository at this point in the history
Signed-off-by: Nianyu Shen <xiaoyu9964@gmail.com>
  • Loading branch information
nianyush committed Jan 12, 2025
1 parent ce5dd2d commit b246a84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/cosign/cli/options/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ func (o *RegistryOptions) GetRegistryClientOpts(ctx context.Context) []remote.Op
}

if o.AllowInsecure {
opts = append(opts, remote.WithTransport(&http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}})) // #nosec G402
tr := http.DefaultTransport.(*http.Transport).Clone()
tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} // #nosec G402
opts = append(opts, remote.WithTransport(tr))
}

// Reuse a remote.Pusher and a remote.Puller for all operations that use these opts.
Expand Down

0 comments on commit b246a84

Please sign in to comment.