For a Playwright browser navigation, set ignoreHTTPSErrors: true on the browser context. In Playwright Test, place the same option under use in playwright.config.ts. The documented default is false, so HTTPS certificate failures are not bypassed unless you opt in. This setting affects browser traffic only; Playwright API requests, the webServer readiness check, and browser downloads through an intercepting proxy have separate configuration points.
Use the setting that matches the failing operation
“Certificate error” can describe several different Playwright operations. Apply the option to the component that is actually making the failing connection:
| Operation | Configuration | What it affects |
|---|---|---|
| Page navigation or resources loaded by a browser context | browser.newContext({ ignoreHTTPSErrors: true }) |
HTTPS errors encountered by that browser context |
| Playwright Test browser sessions | use: { ignoreHTTPSErrors: true } |
HTTPS errors during test navigation and browser use |
APIRequestContext |
Its own ignoreHTTPSErrors option |
Requests made through the API request context, not browser requests |
webServer readiness URL |
webServer.ignoreHTTPSErrors: true |
The readiness fetch Playwright performs before tests start |
| Browser installation behind a TLS-intercepting proxy | NODE_EXTRA_CA_CERTS before installation |
Trust for the download process, not test-page navigation |
Playwright documents the browser-context option in its Browser API and the test-runner form in Test use options. Both document a default of false.
Playwright Test: configure every test context
Create or edit playwright.config.ts and put the option inside use:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems#1 Best Overall
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
ignoreHTTPSErrors: true,
},
});
Run the suite normally:
npx playwright test
The setting is inherited by browser contexts that Playwright Test creates for your tests. It is therefore useful when a development server uses a self-signed certificate or a test environment presents a certificate that is not trusted by the browser.
Limit the bypass to a project or a test
If only one environment needs the bypass, avoid making it global. Playwright configuration supports projects, so you can scope the setting to a project that targets the affected environment:
import { defineConfig } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'local-https',
use: {
baseURL: 'https://localhost:8443',
ignoreHTTPSErrors: true,
},
},
{
name: 'trusted-staging',
use: {
baseURL: 'https://staging.example.test',
},
},
],
});
Run only the project that requires the exception with npx playwright test --project=local-https. Keeping trusted environments strict helps expose accidental certificate problems instead of hiding them.
Direct Playwright code: set the browser-context option
When you launch Playwright yourself rather than through the test runner, pass the option to browser.newContext. The option belongs to the context, not to browserType.launch:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
import { chromium } from 'playwright';
const browser = await chromium.launch();
const context = await browser.newContext({
ignoreHTTPSErrors: true,
});
const page = await context.newPage();
await page.goto('https://localhost:8443/');
console.log(await page.title());
await context.close();
await browser.close();
The equivalent CommonJS JavaScript is:
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
await page.goto('https://localhost:8443/');
console.log(await page.title());
await browser.close();
})();
Use a new context for each independent configuration. Changing a setting after a context has been created does not retrofit that context.
API requests have a separate setting
APIRequestContext traffic does not use the browser context’s certificate policy. The APIRequestContext documentation states that its ignoreHTTPSErrors option is independent and does not affect requests sent from the browser.
import { request } from '@playwright/test';
const api = await request.newContext({
baseURL: 'https://localhost:9443',
ignoreHTTPSErrors: true,
});
const response = await api.get('/health');
console.log(response.status());
await api.dispose();
If a test both calls an API and opens a page, configure both contexts when necessary:
import { chromium } from 'playwright';
import { request } from '@playwright/test';
const browser = await chromium.launch();
const browserContext = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await browserContext.newPage();
await page.goto('https://localhost:8443/');
const apiContext = await request.newContext({ ignoreHTTPSErrors: true });
await apiContext.get('https://localhost:9443/health');
await apiContext.dispose();
await browser.close();
Web-server readiness checks use their own option
When Playwright starts a development server and polls its configured URL, the readiness fetch is not browser navigation. Configure the webServer entry instead. The webServer documentation documents ignoreHTTPSErrors for this fetch and a default of false:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
import { defineConfig } from '@playwright/test';
export default defineConfig({
webServer: {
command: 'npm run dev',
url: 'https://127.0.0.1:8443',
ignoreHTTPSErrors: true,
},
use: {
baseURL: 'https://127.0.0.1:8443',
ignoreHTTPSErrors: true,
},
});
Both entries are intentional: the first lets the readiness check succeed, while the second lets test-created browser contexts navigate to the site. Setting only one can leave the other operation failing.
Browser installation behind an intercepting proxy
A different error appears when a corporate proxy intercepts TLS while Playwright downloads browser binaries. If installation reports self signed certificate in certificate chain, the Playwright browser-installation guide recommends trusting the proxy’s custom root certificate through NODE_EXTRA_CA_CERTS before installing browsers. See Browsers | Playwright.
# macOS or Linux
export NODE_EXTRA_CA_CERTS=/absolute/path/company-root-ca.pem
npx playwright install
# Windows PowerShell
$env:NODE_EXTRA_CA_CERTS = 'C:certscompany-root-ca.pem'
npx playwright install
This is a download trust configuration. It does not replace ignoreHTTPSErrors: true for a test page and should not be added merely because a page under test uses a self-signed certificate.
Diagnose the error before changing configuration
- Identify the failing line. A
page.gotofailure points to browser context settings; a failure fromrequest.getpoints toAPIRequestContext; a message while waiting forwebServer.urlpoints to the readiness setting; an error fromnpx playwright installpoints to download trust. - Confirm the URL and protocol. The option concerns HTTPS certificate validation. A typo, DNS failure, refused connection, or application-level HTTP error needs a different fix.
- Apply the narrowest setting. Prefer a project-specific or context-specific exception over disabling validation for every environment.
- Re-run with diagnostics. Use
npx playwright test --trace onfor a trace of test navigation, and keep the original error text when comparing browser, API, and server behavior. - Remove the bypass when the certificate is fixed. Leaving the setting enabled can allow a man-in-the-middle or misissued certificate to go unnoticed in environments where trust matters.
Common failures and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
page.goto still reports a certificate error |
The option was placed on the API request context or webServer, not the browser context. |
Set ignoreHTTPSErrors: true in use or in browser.newContext. |
| Tests never start because the configured server is unreachable | The readiness fetch rejects the server certificate. | Add webServer.ignoreHTTPSErrors: true; keep the browser use setting if navigation also needs it. |
| API call fails while page navigation works | API and browser contexts have independent certificate policies. | Create the APIRequestContext with its own ignoreHTTPSErrors: true. |
npx playwright install says self signed certificate in certificate chain |
An intercepting proxy presents a private CA during browser download. | Set NODE_EXTRA_CA_CERTS to the proxy’s root certificate, then run the install again. |
| Setting appears ignored after configuration changes | The process is using an already-created browser context or a different configuration file. | Create a fresh context, verify the selected project, and run with the intended config file. |
| The error changes to a timeout | Certificate validation was bypassed, but the page still cannot load its application resources. | Check server availability, routing, DNS, proxy rules, and application logs; the certificate option does not repair those failures. |
Security and CI guidance
- Use the bypass for local development, isolated test certificates, or a deliberately controlled test environment—not as a blanket production policy.
- Scope it to the smallest project or context that needs it, and document why the exception exists.
- Keep normal staging and production projects at the default unless their certificate trust model explicitly requires otherwise.
- For CI behind a corporate proxy, install the organization’s CA correctly for the runner and use
NODE_EXTRA_CA_CERTSonly for the download trust problem described in Playwright’s installation guidance. - When debugging, distinguish a certificate warning from authorization failures, HTTP status codes, redirects, and network timeouts; each has a different remedy.
Or skip the browser setup
If your actual goal is to obtain a website screenshot rather than exercise the site with Playwright, ScreenshotNeo provides a one-request screenshot API. It accepts a URL and returns PNG, JPEG, WebP, or PDF. Cookie and consent banners are accepted and 60-plus known consent platforms, newsletter popups, and chat widgets are removed before capture; each step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
Use the API documentation at https://screenshotneo.com/docs/ for the complete option list. A minimal cURL call is:
Rank #4
- Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request in Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And in Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also exposes an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Its options include full-page and element capture, dark mode, device presets, custom viewports, retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture for up to 100 URLs per call, usage data, and an OpenAPI specification. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Does this option install or trust a certificate?
No. It tells the selected Playwright operation to continue despite HTTPS certificate validation errors. Installing a trusted CA and bypassing validation are different approaches.
Can I use a browser context setting to fix an API request?
No. APIRequestContext has its own ignoreHTTPSErrors option, so configure that context independently.
Why does Playwright need a separate web-server setting?
The readiness URL is fetched by the test runner before browser contexts are created. Its certificate policy is therefore configured under webServer, not under browser use.
Best Value
Frequently Asked Questions
Does this option install or trust a certificate?
No. It bypasses HTTPS certificate validation for the selected Playwright operation; installing a trusted CA is a separate approach.
Can a browser-context setting fix an API request?
No. Configure ignoreHTTPSErrors on the APIRequestContext itself.
Why is there a separate webServer setting?
The readiness URL is fetched by the test runner before browser contexts are created, so it has its own certificate policy.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

