Skip to content

Commit

Permalink
GODRIVER-3120 Add list of possible OS errors to case 11
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvasquez committed May 10, 2024
1 parent ae60d74 commit 6371ed3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mongo/integration/client_side_encryption_prose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6371ed3

Please sign in to comment.