-
Notifications
You must be signed in to change notification settings - Fork 70
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
Unit tests fail on macOS with Go 1.18 because of 1024-bit RSA test certificate #264
Comments
Well, simply updating the test cert to RSA 2048 will drop the lumped in test case for key size warning emitted.
Moreover, the chain verification failure messages are not different between platforms: e.g.
The new error, citing the issuer name is coming from Apple Security Framework, particularly this format string with its fancy quotes. So the PR would be more involved than new key, new cert and change expected output. |
Thanks for the detailed writeup, we'll take a look! |
I decided that we should just change the test to successfully verify the cert chain instead of relying on a platform-specific error string. |
@bdd did an excellent writeup of the issue in #264. To fix this, stop relying on stable error messages between platforms and Go versions by performing a successful certigo connect in the test rather than a failed one. I generated new ECDSA certificates for localhost using https://github.com/square/certstrap.
This patch updates the GoVmomi SOAP client to use DialTLSContext instead of DialTLS, as the latter has been deprecated for multiple, major Go versions. This patch also updates how the SOAP client handles TLS validation with respect to thumbprints. Go 1.18+ adopted the host's certificate verification framework, so it is necessary to alter a few things to continue to support thumbprint verification. * https://tip.golang.org/doc/go1.18 (search for "Certificate.Verify") * square/certigo#264
This patch updates the GoVmomi SOAP client to use DialTLSContext instead of DialTLS, as the latter has been deprecated for multiple, major Go versions. This patch also updates how the SOAP client handles TLS validation with respect to thumbprints. Go 1.18+ adopted the host's certificate verification framework, so it is necessary to alter a few things to continue to support thumbprint verification. * https://tip.golang.org/doc/go1.18 (search for "Certificate.Verify") * square/certigo#264
This patch updates the GoVmomi SOAP client to use DialTLSContext instead of DialTLS, as the latter has been deprecated for multiple, major Go versions. This patch also updates how the SOAP client handles TLS validation with respect to thumbprints. Go 1.18+ adopted the host's certificate verification framework, so it is necessary to alter a few things to continue to support thumbprint verification. * https://tip.golang.org/doc/go1.18 (search for "Certificate.Verify") * square/certigo#264
Problem:
TestConnect
fails on macOS when using Go 1.18Dive:
Where does this
certificate is using a broken key size
error come from?Looks like from from Apple Security Framework https://cs.github.com/apple-open-source/macos/blob/4c64a93f78278a48fd0c9bce26737010c16668e6/Security/OSX/sec/Security/SecFrameworkStrings.h#L246.
Apple's App Transport Security (ATS) on all platforms now requires:
Go uses Apple Security Framework now?
Go 1.18 switched TLS verification path to platform APIs for macOS and iOS.
From: Go 1.18 Release Notes:
Next:
Update
localhostKey
to at least 2048-bits and generating a newlocalhostCert
with it in cli/cli_test.go.certigo/cli/cli_test.go
Line 19 in 41b5b73
The text was updated successfully, but these errors were encountered: