-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Feature]: Support client certificates signed with a private certificate authority #33414
Comments
A simpler solution might be to turn off validation of client certs on the proxy. Why does the Playwright proxy care if I use an invalid client certificate? |
What http server are you using? I saw you are navigating to I think it only supports TLSv1.2 and TLSv13. Not entirely sure about ciphers. Usually we align with modern Node.js which aligns with recent OpenSSL - so this worth checking if your server is e.g. using old ciphers. Using cURL might yield something useful for debugging as well:
|
Apache reverse proxy, which is configured with
Which I understand to mean TLS1.2 or higher, and at least a 128-bit cipher. When we use the client certificate from a browser, it works fine. Apache logs the message
and then the handshake succeeds. When using Playwright, the Apache logs report the same message as above, and then
Which made me think the certificate was not making it to Apache. Does Playwright inject a forward proxy between the test code and Apache? Based on the But to your point, the client certificates are using older encryption. First I'll try curl and then try creating a newer client certificate. |
I decided to start fresh, using your notes in tests/assets/client-certificates/README.md as a guide.
After all that, when I tried the POC code above this time using the new client certificate, I get the same error. |
Great debugging! Your Apache configuration does not include TLSv1.3, you'd need to do:
The
This suggests that no certificates were sent along - maybe the origin does not match? What origin do you specify? |
Hi @mxschmitt , Thanks for your attention. Unfortunately, our dev infra is so old that Apache won't start with +TLSv1.3. Our current workaround is to override tls.createSecureContext() in globalhooks.ts :
Is it correct to say that Playwright won't work unless the server under test supports TLSv1.3? |
Playwright aka. Node.js works also with TLSv1.2 - just OpenSSL which Node.js uses under the hood doesn't consider your certificate as secure anymore, since it relies on older non-secure ciphers. An easier workaround is to put this into your import tls from "tls";
tls.DEFAULT_CIPHERS = "DEFAULT:@SECLEVEL=0"; Linking #33563 since it seems similar. |
🚀 Feature Request
In our dev environment, we use client certificates that are signed by an in-house CA.
When I try to use one of these client certificates with Playwright , it fails with the error:
My best guess is that the proxy rejects our client cert because it is not signed by one of the "well-known CAs curated by Mozilla".
If this guess is correct, and Playwright allowed us to override the trusted CA certificates (by passing the
ca
argument from the client certificate to thetls.createSecureContext
call), then I believe our setup should work.FWIW these certs did work with Cypress.
Example
(We are using the Java wrapper around Playwright.)
Motivation
Improve support for running tests against servers that require client certificates.
The text was updated successfully, but these errors were encountered: