← Back to Discord Forum

provide custom cert with proxy

sajjad.kernelposted in #help-playwright
Open in Discord

Is there a way to provide a custom cert for a proxy with play wright? I was trying to search any documentation that I can find but was not able to locate one?

This thread is trying to answer question "Is there a way to provide a custom cert for a proxy with Playwright?"

0 replies


Sure, you can set up a custom certificate for a proxy with Playwright. If your proxy's requests are intercepted with a custom untrusted certificate authority (CA) and you're seeing an "Error: self signed certificate in certificate chain" while downloading browsers, you can set your custom root certificates via the NODE_EXTRA_CA_CERTS environment variable before installing the browsers.

Here's how you can do it:

export NODE_EXTRA_CA_CERTS="/path/to/cert.pem"

Once you've set this environment variable, go ahead and install Playwright. It will use your custom root certificates when downloading browsers.

If you're configuring Playwright to download browsers from an internal artifact repository instead of Microsoft's CDN, you can use the PLAYWRIGHT_DOWNLOAD_HOST environment variable. This lets you specify a custom location for downloading browser binaries.

Remember, these configurations are specific to Playwright and may not apply in other contexts or frameworks. Always refer to Playwright's documentation for more detailed instructions on how to configure proxies and certificates.

In a nutshell, by setting the NODE_EXTRA_CA_CERTS environment variable with your custom root certificates and configuring PLAYWRIGHT_DOWNLOAD_HOST if necessary, you can set up a custom cert for a proxy in Playwright.

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.