-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
about function loadSystemRoots #100
Comments
|
@lysShub thanks for your feedback. I agree we should check exit code regarding point number 1. |
my test result is, when a required cert missing: |
not need to manually create CertPool, if VerifyOptions.Roots is nil and golang will call system API to verify: https://github.com/golang/go/blob/go1.22.0/src/crypto/x509/verify.go#L770 @LordNoteworthy |
Thanks a lot @lysShub, I should be able to fix this by the end of the week |
Hey @lysShub
Can you post a quick benchmark how this is faster ? My tests shows that when |
@LordNoteworthy I mean is that no need the certPool, but directly: // Let's load the system root certs.
if !pe.opts.DisableCertValidation {
certValid = pkcs.Verify() == nil
} |
I see, does this work prior to go v1.22 ? |
yes, it depend on Verify,not need to distinguish Windows or Linux |
ah here: https://github.com/golang/go/blob/go1.22.0/src/crypto/x509/verify.go#L770, let me check that |
to be continue, finally call windows system function, such as syscall.CertGetCertificateChain |
// Let's load the system root certs.
if !pe.opts.DisableCertValidation {
certValid = pkcs.Verify() == nil
} The unit tests fails when I changed it as above. Can you please submit a PR ? |
if !strings.Contains(string(out), "command completed successfully") {
not work on other language system;maybeif cmd.ProcessState.ExitCode() != 0 {
The text was updated successfully, but these errors were encountered: