fix TLS tests on newer go versions and MacOS #1191
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 sincetls.CertificateVerificationError
is returned instead of the expected, contrary to older versions wherex509.UnknownAuthorityError
orx509.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.