Skip to content

Commit b6a2bbb

Browse files
GODRIVER-3120 Add list of possible OS errors to case 11 (#1637)
1 parent ae60d74 commit b6a2bbb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mongo/integration/client_side_encryption_prose_test.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1628,8 +1628,16 @@ func TestClientSideEncryptionProse(t *testing.T) {
16281628
_, err := cpt.clientEnc.CreateDataKey(context.Background(), tc.name, dkOpts)
16291629

16301630
assert.NotNil(mt, err, "expected error, got nil")
1631-
assert.True(mt, strings.Contains(err.Error(), "certificate signed by unknown authority"),
1632-
"expected error '%s' to contain '%s'", err.Error(), "certificate signed by unknown authority")
1631+
1632+
possibleErrors := []string{
1633+
"x509: certificate signed by unknown authority", // Windows
1634+
"x509: “valid.testing.golang.invalid” certificate is not trusted", // MacOS
1635+
"x509: certificate is not authorized to sign other certificates", // All others
1636+
}
1637+
1638+
assert.True(t, containsSubstring(possibleErrors, err.Error()),
1639+
"expected possibleErrors=%v to contain %v, but it didn't",
1640+
possibleErrors, err.Error())
16331641

16341642
// call CreateDataKey with CEO & TLS with each provider and corresponding master key
16351643
cpt = setup(mt, nil, defaultKvClientOptions, validClientEncryptionOptionsWithTLS)

0 commit comments

Comments
 (0)