You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a golang program, I need to access a TLS port and get the following information
DNSNames from all peer certificates
Whether the certificate is valid
So I need to enable InsecureSkipVerify, but golang does not recognize the root certificate somehow. e.g curl believes www.bing.com has a valid certificate, but not according to x509.Verify.
My test code can verify the certificate on MacOS, but not on Ubuntu 22.04 server, does anyone know what's wrong?
# /root/go/bin/go run http-test.go
[] x509: certificate signed by unknown authority
The cert store only holds roots, your checking a leaf, missing the intermediates.
This is an incorrect usage of Verify, a proper example can be seen in crypto/tls.
MacOS hands it off to the system verifier.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a golang program, I need to access a TLS port and get the following information
So I need to enable InsecureSkipVerify, but golang does not recognize the root certificate somehow. e.g curl believes www.bing.com has a valid certificate, but not according to x509.Verify.
My test code can verify the certificate on MacOS, but not on Ubuntu 22.04 server, does anyone know what's wrong?
Full source code
What did you expect to see?
x509.Verify returns successfully
What did you see instead?
The text was updated successfully, but these errors were encountered: