Skip to content

fix TLS tests on newer go versions and MacOS #1191

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zregvart
Copy link

@zregvart zregvart commented Jun 5, 2025

The TLS tests in ssl_test.go assert that specific errors are reported for specific situations. This fails on newer (1.20+) versions of go since tls.CertificateVerificationError is returned instead of the expected, contrary to older versions where x509.UnknownAuthorityError or x509.HostnameError would be returned.

This maintains the same assertions on go < 1.20, and allows for the new error on go >= 1.20.

In addition to that, on MacOS the error string x509: “postgres” certificate is not standards compliant is returned instead of any of these, this seems to be due to the version of OpenSSL provided by MacOS, see golang/go#51991 for details.

The TLS tests in `ssl_test.go` assert that specific errors are reported
for specific situations. This fails on newer (1.20+) versions of go
since `tls.CertificateVerificationError` is returned instead of the
expected, contrary to older versions where `x509.UnknownAuthorityError`
or `x509.HostnameError` would be returned.

This maintains the same assertions on go < 1.20, and allows for the new
error on go >= 1.20.

In addition to that, on MacOS the error string `x509: “postgres”
certificate is not standards compliant` is returned instead of any of
these, this seems to be due to the version of OpenSSL provided by MacOS,
see golang/go#51991 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant