Skip to content
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

GODRIVER-3120 Add list of possible OS errors to case 11 #1637

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading