Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Nov 4, 2024
1 parent 462e23b commit 7fe359e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/notation/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/notaryproject/notation-core-go/revocation/purpose"
"github.com/notaryproject/notation-go"
"github.com/notaryproject/notation-go/dir"
"github.com/notaryproject/notation-go/log"
"github.com/notaryproject/notation-go/plugin"
"github.com/notaryproject/notation-go/verifier"
"github.com/notaryproject/notation-go/verifier/crl"
Expand Down Expand Up @@ -232,6 +233,8 @@ func printMetadataIfPresent(outcome *notation.VerificationOutcome) {
}

func getVerifier(ctx context.Context) (notation.Verifier, error) {
logger := log.GetLogger(ctx)

// revocation check
ocspHttpClient := httputil.NewClient(ctx, &http.Client{Timeout: 2 * time.Second})
crlFetcher, err := corecrl.NewHTTPFetcher(httputil.NewClient(ctx, &http.Client{Timeout: 5 * time.Second}))
Expand All @@ -246,6 +249,7 @@ func getVerifier(ctx context.Context) (notation.Verifier, error) {
if err != nil {
return nil, err
}
logger.Warnln("Discard any crl cache error")
crlFetcher.DiscardCacheError = true // discard cache error
revocationCodeSigningValidator, err := revocation.NewWithOptions(revocation.Options{
OCSPHTTPClient: ocspHttpClient,
Expand Down

0 comments on commit 7fe359e

Please sign in to comment.