Skip to content

Commit

Permalink
Fixed comments about the certificate pool not being available on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Janos Bonic committed May 14, 2022
1 parent 20aa3df commit 057fd0a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
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

0 comments on commit 057fd0a

Please sign in to comment.