Repository navigation
New API to find certificate given a common name. - #86
Conversation
Signed-off-by: Apurv Barve <[email protected]>
|
@alexherrero @bagarber : Can you please review this PR? |
|
@sethvargo : Can you help review this PR? |
|
I don't have permissions on this repo, sorry. |
|
Sorry for the delay, taking a look.
…On Thu, Aug 14, 2025 at 9:18 AM Seth Vargo ***@***.***> wrote:
*sethvargo* left a comment (google/certtostore#86)
<#86 (comment)>
I don't have permissions on this repo, sorry.
—
Reply to this email directly, view it on GitHub
<#86 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL35KAPTJ6WTM5LQKJBAJW33NSZGZAVCNFSM6AAAAACDMZ743KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOBZGA2DQMRUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Brian A. Garber | Software Engineer, gWindows Team | ***@***.***
|
bagarber
left a comment
There was a problem hiding this comment.
Any chance there's relevant tests we can add to certtostore_windows_test.go?
Yes, i added two new test cases. |
| certContext, | ||
| ) | ||
| if err != nil { | ||
| return nil, nil, nil, fmt.Errorf("error finding certificate by common name %q: %v", |
There was a problem hiding this comment.
Prefer to omit the word "error" in error strings.
| } | ||
| t.Fatalf("expected error for unknown common name, got none") | ||
| } | ||
| if !strings.Contains(err.Error(), "no certificate found") { |
There was a problem hiding this comment.
Strongly prefer looking for the value of the error instead of the error string (use errors.Is()).
https://go.dev/wiki/ErrorValueFAQ
…a common name. Signed-off-by: Apurv Barve <[email protected]>
New API to find certificate given a common name.
Save the certChain gotten through resolveChains.