Skip to content

Commit

Permalink
fix: set tls config while retaining other fields from default http tr…
Browse files Browse the repository at this point in the history
…ansport

Signed-off-by: Nianyu Shen <xiaoyu9964@gmail.com>
  • Loading branch information
nianyush committed Jan 12, 2025
1 parent 87c08b0 commit aa61fea
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 @@ -151,7 +151,9 @@ func (o *RegistryOptions) GetRegistryClientOpts(ctx context.Context) []remote.Op

tlsConfig, err := o.getTLSConfig()
if err == nil {
opts = append(opts, remote.WithTransport(&http.Transport{TLSClientConfig: tlsConfig}))
tr := http.DefaultTransport.(*http.Transport).Clone()
tr.TLSClientConfig = tlsConfig
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 aa61fea

Please sign in to comment.