From 6119668422f83b7afd1db1f936d59be718bc4960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Wed, 2 Aug 2023 13:52:52 +0200 Subject: [PATCH] http_proxy: log when using custom root CA certificates --- http_proxy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http_proxy.go b/http_proxy.go index c1f682e5..19cefc29 100644 --- a/http_proxy.go +++ b/http_proxy.go @@ -132,8 +132,12 @@ func NewHTTPProxy(cfg *HTTPProxyConfig, pr PACResolver, cm *CredentialsMatcher, if rt == nil { log.Infof("HTTP transport not configured, using standard library default") rt = http.DefaultTransport.(*http.Transport).Clone() //nolint:forcetypeassert // we know it's a *http.Transport - } else if _, ok := rt.(*http.Transport); !ok { + } else if tr, ok := rt.(*http.Transport); !ok { log.Debugf("using custom HTTP transport %T", rt) + } else { + if tr.TLSClientConfig != nil && tr.TLSClientConfig.RootCAs != nil { + log.Infof("using custom root CA certificates") + } } hp := &HTTPProxy{ config: *cfg,