From e8d7ff28c8ebcbd25b3043eaef6ecffc1126bbc1 Mon Sep 17 00:00:00 2001 From: Shubham Minglani Date: Wed, 4 Dec 2024 11:49:36 +0530 Subject: [PATCH] Ignore setting OCSP env if already set (#1199) --- connection_util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/connection_util.go b/connection_util.go index 3d0736373..f26fc90c1 100644 --- a/connection_util.go +++ b/connection_util.go @@ -325,6 +325,12 @@ func populateChunkDownloader( func setupOCSPEnvVars(ctx context.Context, host string) error { host = strings.ToLower(host) + + // only set OCSP envs if not already set + if val, set := os.LookupEnv(cacheServerURLEnv); set { + logger.WithContext(ctx).Debugf("OCSP Cache Server already set by user for %v: %v\n", host, val) + return nil + } if isPrivateLink(host) { if err := setupOCSPPrivatelink(ctx, host); err != nil { return err