Skip to content
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
11 changes: 9 additions & 2 deletions tests/library/client-certificates.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,15 @@ test.describe('browser', () => {
keyPath: asset('client-certificates/client/self-signed/key.pem'),
}],
});
const error = await page.goto(serverURL).catch(e => e);
expect(error.message).toMatch(/net::ERR_EMPTY_RESPONSE|NS_ERROR_NET_RESET|Connection terminated unexpectedly|The network connection was lost/);
const result = await page.goto(serverURL).catch(e => e);
if (result instanceof Error) {
// The server closed the connection with FIN after the TLS handshake.
expect(result.message).toMatch(/net::ERR_EMPTY_RESPONSE|NS_ERROR_NET_RESET|Connection terminated unexpectedly|The network connection was lost/);
} else {
// The server reset the connection, which the proxy reports as a client certificate error.
expect(result.status()).toBe(503);
await expect(page.getByText('Playwright client-certificate error')).toBeVisible();
}
await page.close();
});

Expand Down