diff --git a/resolver/addressable_resolver.go b/resolver/addressable_resolver.go index bbbcb78b67..e0b2f3a448 100644 --- a/resolver/addressable_resolver.go +++ b/resolver/addressable_resolver.go @@ -257,7 +257,7 @@ func (r *URIResolver) addressableFromDestinationRef(ctx context.Context, dest du return nil, apierrs.NewBadRequest(fmt.Sprintf("hostname missing in address of %s", dest.Ref)) } - if addr.CACerts == nil { + if dest.CACerts != nil && *dest.CACerts != "" { addr.CACerts = dest.CACerts } diff --git a/resolver/addressable_resolver_test.go b/resolver/addressable_resolver_test.go index b5701ddaf0..589a036806 100644 --- a/resolver/addressable_resolver_test.go +++ b/resolver/addressable_resolver_test.go @@ -848,7 +848,7 @@ func TestAddressableFromDestinationV1CACerts(t *testing.T) { addressableWithCACert(), }, addr: addressableWithCACert(), - wantCert: CACert, + wantCert: certDestination, }} for n, tc := range tests {