From 8452cb37d9d70c9475003ce5b89daed42c43756d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 21 May 2024 09:01:04 -0500 Subject: [PATCH] GODRIVER-3120 [master] Add list of possible OS errors to case 11 (#1639) Co-authored-by: Preston Vasquez --- .../integration/client_side_encryption_prose_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/integration/client_side_encryption_prose_test.go b/internal/integration/client_side_encryption_prose_test.go index ff478a22ac..d5c829ea43 100644 --- a/internal/integration/client_side_encryption_prose_test.go +++ b/internal/integration/client_side_encryption_prose_test.go @@ -1628,8 +1628,16 @@ func TestClientSideEncryptionProse(t *testing.T) { _, err := cpt.clientEnc.CreateDataKey(context.Background(), tc.name, dkOpts) assert.NotNil(mt, err, "expected error, got nil") - assert.True(mt, strings.Contains(err.Error(), "certificate signed by unknown authority"), - "expected error '%s' to contain '%s'", err.Error(), "certificate signed by unknown authority") + + possibleErrors := []string{ + "x509: certificate signed by unknown authority", // Windows + "x509: “valid.testing.golang.invalid” certificate is not trusted", // MacOS + "x509: certificate is not authorized to sign other certificates", // All others + } + + assert.True(t, containsSubstring(possibleErrors, err.Error()), + "expected possibleErrors=%v to contain %v, but it didn't", + possibleErrors, err.Error()) // call CreateDataKey with CEO & TLS with each provider and corresponding master key cpt = setup(mt, nil, defaultKvClientOptions, validClientEncryptionOptionsWithTLS)