test fixes for api changes

pull/16263/head
DanStough 2 years ago
parent 31bbca9fe4
commit 2f54191353
No known key found for this signature in database
GPG Key ID: 0D994ED7D73D7809

@ -478,7 +478,7 @@ func TestLeader_PeeringSync_FailsForTLSError(t *testing.T) {
t.Run("server-name-validation", func(t *testing.T) { t.Run("server-name-validation", func(t *testing.T) {
testLeader_PeeringSync_failsForTLSError(t, func(token *structs.PeeringToken) { testLeader_PeeringSync_failsForTLSError(t, func(token *structs.PeeringToken) {
token.ServerName = "wrong.name" token.ServerName = "wrong.name"
}, `transport: authentication handshake failed: x509: certificate is valid for server.dc1.peering.11111111-2222-3333-4444-555555555555.consul, not wrong.name`) }, `transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate is valid for server.dc1.peering.11111111-2222-3333-4444-555555555555.consul, not wrong.name`)
}) })
t.Run("bad-ca-roots", func(t *testing.T) { t.Run("bad-ca-roots", func(t *testing.T) {
wrongRoot, err := os.ReadFile("../../test/client_certs/rootca.crt") wrongRoot, err := os.ReadFile("../../test/client_certs/rootca.crt")
@ -486,7 +486,7 @@ func TestLeader_PeeringSync_FailsForTLSError(t *testing.T) {
testLeader_PeeringSync_failsForTLSError(t, func(token *structs.PeeringToken) { testLeader_PeeringSync_failsForTLSError(t, func(token *structs.PeeringToken) {
token.CA = []string{string(wrongRoot)} token.CA = []string{string(wrongRoot)}
}, `transport: authentication handshake failed: x509: certificate signed by unknown authority`) }, `transport: authentication handshake failed: tls: failed to verify certificate: x509: certificate signed by unknown authority`)
}) })
} }

@ -906,7 +906,7 @@ func TestConfigurator_outgoingWrapperALPN_serverHasNoNodeNameInSAN(t *testing.T)
_, err = wrap("dc1", "bob", "foo", client) _, err = wrap("dc1", "bob", "foo", client)
require.Error(t, err) require.Error(t, err)
_, ok := err.(x509.HostnameError) _, ok := err.(*tls.CertificateVerificationError)
require.True(t, ok) require.True(t, ok)
client.Close() client.Close()

Loading…
Cancel
Save