Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of Fix accidental debug logging in the OCSP helper client into release/1.18.x #28477

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/28450.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
auth/cert: During certificate validation, OCSP requests are debug logged even if Vault's log level is above DEBUG.
```
1 change: 1 addition & 0 deletions sdk/helper/ocsp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ func (c *Client) GetRevocationStatus(ctx context.Context, subject, issuer *x509.
timeout := defaultOCSPResponderTimeout

ocspClient := retryablehttp.NewClient()
ocspClient.Logger = c.Logger()
ocspClient.RetryMax = conf.OcspMaxRetries
ocspClient.HTTPClient.Timeout = timeout
ocspClient.HTTPClient.Transport = newInsecureOcspTransport(conf.ExtraCas)
Expand Down
13 changes: 7 additions & 6 deletions sdk/helper/ocsp/ocsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ func TestOCSP(t *testing.T) {
for _, tgt := range targetURL {
c.ocspResponseCache, _ = lru.New2Q(10)
for _, tr := range transports {
c := &http.Client{
Transport: tr,
Timeout: 30 * time.Second,
}
req, err := http.NewRequest("GET", tgt, bytes.NewReader(nil))
ocspClient := retryablehttp.NewClient()
ocspClient.Logger = c.Logger()
ocspClient.RetryMax = conf.OcspMaxRetries
ocspClient.HTTPClient.Timeout = 30 * time.Second
ocspClient.HTTPClient.Transport = tr
req, err := retryablehttp.NewRequest("GET", tgt, bytes.NewReader(nil))
if err != nil {
t.Fatalf("fail to create a request. err: %v", err)
}
res, err := c.Do(req)
res, err := ocspClient.Do(req)
if err != nil {
t.Fatalf("failed to GET contents. err: %v", err)
}
Expand Down
Loading