You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
suggests there is indeed a way. The core problem I see is that you’d want the file read to get done in JS rather than passing bytes on from perl, as those tend to choke JSON encoders/decoders.
I’ll need a mechanism to hint playwright_server that it ought to read a particular file parameter.
The text was updated successfully, but these errors were encountered:
We use client certificates at my company, so I was able to take a look at this. I think you can close the issue.
Playwright version 1.46.0 handles client certificates natively. You can pass them in via the defineConfig configuration object or through the context declaration. I don't think we have access to defineConfig through playwright_server, but passing them through newContext worked fine for me.
my $host = 'https://my.host.com';
my $handle = Playwright->new();
my $browser = $handle->launch( headless => 0, type => 'chrome' );
my $context = $browser->newContext( {
clientCertificates => [{
origin => $host,
certPath => '/Users/caran/cert/myclientcert.crt',
keyPath => '/Users/caran/cert/myprivatekey.pem',
passphrase => 'thepassphrase'
}] } );
my $page = $context->newPage();
$page->goto($host, { waitUntil => 'networkidle' });
On MacOS, I did have some issues with .pfx files but splitting up the certificate and passing both parts works fine.
microsoft/playwright#1799 (comment)
suggests there is indeed a way. The core problem I see is that you’d want the file read to get done in JS rather than passing bytes on from perl, as those tend to choke JSON encoders/decoders.
I’ll need a mechanism to hint playwright_server that it ought to read a particular file parameter.
The text was updated successfully, but these errors were encountered: