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

Fixed comments about the certificate pool not being available on Windows #196

Merged
1 commit merged into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func main() {
regexp.MustCompile(`\.pem`),
)

// Add system certificates. This doesn't work on Windows.
// Add system certificates. This doesn't work on Windows before Go 1.18.
tls.CACertsFromSystem()

// Add a custom cert pool as a source of certificates. This option is
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ There are several ways to create a client instance. The most basic way is to use
// Password
"super-secret",
// Pull CA certificates from the operating system.
// This won't work on Windows. See below for an extended example.
// This won't work on Windows before Go 1.18. See below for an extended example.
ovirtclient.TLS().CACertsFromSystem(),
// Don't log.
ovirtclientlog.NewNOOPLogger(),
Expand Down
2 changes: 1 addition & 1 deletion scripts/get_test_image/get_test_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var testImageDownloadHTTPClient = &http.Client{
func getTestImageDownloadCertPool() *x509.CertPool {
certPool, err := x509.SystemCertPool()
if err != nil {
// This will happen on Windows where system pools are not supported.
// This will happen on Windows where system pools are not supported before Go 1.18.
certPool = x509.NewCertPool()
certPool.AppendCertsFromPEM(gitHubCerts)
}
Expand Down
2 changes: 1 addition & 1 deletion tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (s *standardTLSProvider) createCertPool() (*x509.CertPool, error) {

certPool, err := x509.SystemCertPool()
if err != nil {
// This is the case on Windows where the system certificate pool is not available.
// This is the case on Windows before go 1.18 where the system certificate pool is not available.
// See https://github.com/golang/go/issues/16736
return nil, wrap(err, ETLSError, "system cert pool not available")
}
Expand Down
2 changes: 1 addition & 1 deletion tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func ExampleTLS() {
// names.
tls.CACertsFromDir("/path/to/certs", regexp.MustCompile(`\.pem`))

// Add system certificates. This does not work on Windows.
// Add system certificates. This does not work on Windows before Go 1.18.
tls.CACertsFromSystem()

// Disable certificate verification. This is a bad idea.
Expand Down