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

fix: revocation response status code should be 200 #239

Merged
merged 7 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion revocation/crl/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func fetchCRL(ctx context.Context, crlURL string, client *http.Client) (*x509.Re
return nil, fmt.Errorf("request failed: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to download with status code: %d", resp.StatusCode)
}
// read with size limit
Expand Down
2 changes: 1 addition & 1 deletion revocation/internal/ocsp/ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func executeOCSPCheck(ctx context.Context, cert, issuer *x509.Certificate, serve
}
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode >= 300 {
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to retrieve OCSP: response had status code %d", resp.StatusCode)
}

Expand Down
Loading