Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

For a Playwright browser navigation, set ignoreHTTPSErrors: true on the browser context. In Playwright Test, place it under use in playwright.config.ts. The documented default is false. API requests, web-server readiness checks, and browser downloads each have separate certificate settings, so first identify which operation is failing.

Use the setting that matches the failing operation

Playwright does not use one global switch for every HTTPS request. Select the configuration point from this table, then apply the smallest change necessary.

Operation Setting Where it goes Documentation
Browser page navigation ignoreHTTPSErrors: true browser.newContext() or Playwright Test’s use BrowserContext and Test use options
APIRequestContext traffic ignoreHTTPSErrors: true The API request context options APIRequestContext
webServer readiness URL ignoreHTTPSErrors: true The webServer configuration Web server
Browser download through an intercepting proxy NODE_EXTRA_CA_CERTS Set it to the proxy’s custom root certificate before installation Browsers

The similarly named options are scoped independently. Enabling the browser-context option will not change API requests or the readiness probe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ignore HTTPS errors in Playwright Test

Configure every test context

Add ignoreHTTPSErrors: true inside the use object in playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    ignoreHTTPSErrors: true,
  },
});

This applies to the browser contexts created by Playwright Test. If omitted, the documented default is false; the option was added in Playwright v1.10. See the configuration reference for the current option name and behavior.

Limit the setting to a project or a test

If only one browser project or a small group of tests uses a development certificate, keep production-like projects strict and enable the option only where needed:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'local-https',
      use: {
        baseURL: 'https://localhost:8443',
        ignoreHTTPSErrors: true,
      },
    },
    {
      name: 'strict-https',
      use: {
        baseURL: 'https://staging.example.test',
        ignoreHTTPSErrors: false,
      },
    },
  ],
});

A project-level value is easier to audit than silently weakening every test. Keep the setting close to the environment that actually uses the untrusted certificate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the option when creating a browser context directly

When you use Playwright without the test runner, pass the option to browser.newContext(). It belongs to the context, not to browserType.launch():

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 BrowserContext option defaults to false. Every page created from this context inherits the context’s behavior. A second context created without the option will continue to reject the certificate.

Handle APIRequestContext certificate errors separately

Requests made through Playwright’s API client do not use the browser context. Configure the API request context itself:

import { request } from '@playwright/test';

const api = await request.newContext({
  baseURL: 'https://localhost:8443',
  ignoreHTTPSErrors: true,
});

const response = await api.get('/health');
console.log(response.status());

await api.dispose();

The APIRequestContext documentation explicitly treats this option as separate from browser traffic. If a page loads successfully but an API fixture still reports a certificate error, add the option to the API context rather than changing the browser configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ignore errors for the web-server readiness check

Playwright Test can start a local server and poll a URL before running tests. The readiness fetch has its own ignoreHTTPSErrors property:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  webServer: {
    command: 'npm run start:test',
    url: 'https://localhost:8443',
    ignoreHTTPSErrors: true,
  },
});

This affects the fetch used to decide whether the configured server is ready; it does not configure browser navigation. The default is false. Once the readiness check passes, browser contexts still need their own setting if they visit the same self-signed endpoint. See the web-server options.

When the error occurs while installing browsers

A message such as self signed certificate in certificate chain during npx playwright install can come from a corporate proxy that intercepts download traffic. That is not a page-navigation failure, so changing ignoreHTTPSErrors in a test will not fix it.

Obtain the proxy’s custom root CA from your network administrator and set NODE_EXTRA_CA_CERTS before installing:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
export NODE_EXTRA_CA_CERTS=/path/to/corporate-root-ca.pem
npx playwright install

On Windows PowerShell:

$env:NODE_EXTRA_CA_CERTS = 'C:certscorporate-root-ca.pem'
npx playwright install

The official browser installation guide describes this as the solution for an intercepting proxy with a custom untrusted CA. Use a PEM file containing the appropriate root certificate, verify the path is readable by the process, and set the variable in the same shell or CI job that runs the installation.

Diagnose before changing configuration

  1. Read the failing command and stack trace. A failure from page.goto() points to a browser context; a failure from request.get() points to an API context; a failure before tests start may be the webServer probe or browser installation.
  2. Check the URL and certificate chain. Confirm whether the endpoint is local, self-signed, staging-only, or being re-signed by a proxy. A hostname mismatch, expired certificate, or missing intermediate can all surface as HTTPS errors.
  3. Apply the matching setting. Do not assume that enabling one context changes another operation.
  4. Retry with tracing or verbose logs. This helps establish whether the failure happens during startup, navigation, a redirect, an API call, or a download.
  5. Keep the exception narrow. Prefer a project, fixture, or dedicated context for a test-only certificate instead of weakening unrelated environments.

Security and maintenance considerations

What the option changes

ignoreHTTPSErrors: true allows the configured Playwright operation to continue when the certificate cannot be trusted. It is useful for local development, test fixtures, and controlled staging endpoints, but it removes certificate validation for that scope. It does not repair the certificate or make an untrusted endpoint suitable for production security decisions.

Separate test and production configuration

Keep the default (false) for environments where certificate validation is part of what you are testing. Use an explicit project name, environment variable, or fixture to make the exception visible in code review. If your test is specifically validating certificate failures, do not enable the option for that test.

Certificate trust versus browser downloads

NODE_EXTRA_CA_CERTS extends Node’s trust store for processes such as browser installation. It is not a substitute for the browser-context setting, and the browser-context setting is not a substitute for installing through a proxy with its root CA configured.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common errors and fixes

Symptom Likely cause Fix
page.goto() fails with an HTTPS error The browser context still uses the default false Add ignoreHTTPSErrors: true under Playwright Test’s use or to browser.newContext().
API fixture fails while pages work The API request context has separate options Set ignoreHTTPSErrors: true in request.newContext() or the API fixture configuration.
Tests never start; readiness URL fails The webServer probe rejects the certificate Set webServer.ignoreHTTPSErrors: true and separately configure browser contexts if needed.
npx playwright install reports a self-signed chain An intercepting proxy presents a custom CA Set NODE_EXTRA_CA_CERTS to the proxy root certificate before installation.
The option appears to do nothing It was placed on the wrong object or the failing request uses another context Identify the operation from the stack trace and move the setting to that operation’s documented configuration point.
Only one redirected URL fails The redirect reaches a host with a different certificate problem Inspect the complete redirect chain and apply the setting to the context handling the navigation; also verify the target host and certificate outside the test.

Performance, reliability, and CI notes

  • Performance: The option changes certificate validation behavior; it does not by itself increase browser launch parallelism or remove page-load waits.
  • Reliability: A test may pass with an ignored certificate while the same endpoint is unusable by real clients. Keep a separate strict-HTTPS job when certificate correctness matters.
  • CI consistency: Put the setting in checked-in Playwright configuration or a clearly documented fixture. For proxy downloads, export NODE_EXTRA_CA_CERTS in the installation step, not only in a later test step.
  • Scope: Context-level configuration applies to pages in that context. API and readiness settings must be maintained alongside their own configuration.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is simply to capture a page image or PDF rather than run browser assertions, ScreenshotNeo provides a website screenshot API and MCP server. It accepts one GET request and can return PNG, JPEG, WebP, or PDF. The API call avoids configuring a local Playwright browser:

Best Value
Sale
The Web Application Hacker's Handbook: Finding and Exploiting Security Flaws
  • Comes with secure packaging
  • It can be a gift item
  • Easy to read text

See the ScreenshotNeo API documentation for parameters and response details.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

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)

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 accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response reports the result through X-Page-Verdict and X-Billed headers. Its MCP server includes take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

Every plan includes the full feature set, including full-page and element capture, device presets, custom viewport and retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, blocking rules, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, caching with a chosen TTL, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Pricing is Free for 1,000 shots per month with no card, then Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000; yearly billing gives two months free. Create a free ScreenshotNeo account to get 1,000 screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does ignoreHTTPSErrors install or trust a certificate on my operating system?

No. It changes how the configured Playwright operation handles certificate validation; it does not add a CA to the OS or repair the server certificate.

Can I enable the option only for one page?

The documented setting is attached to a browser context. Create a separate context with ignoreHTTPSErrors: true for the pages that need it, and leave other contexts at the default.

Why does a certificate error appear only in CI?

CI may use a different proxy, certificate chain, hostname, or browser-install environment. Check whether the failure is navigation, API traffic, readiness polling, or browser download, then configure that operation specifically.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.