Playwright Self Signed Certificate Errors: Three Causes
Three owned failures print the same certificate error. Read the certificate the browser actually got, then decide what ignoring the error changes.
BotBrowser Team
Want the structured docs for Getting Started?
This article lives in the editorial library. For step-by-step setup, reference material, and ongoing updates, jump into the docs section.
net::ERR_CERT_AUTHORITY_INVALID does not tell you why the navigation failed. In three owned local fixtures, a genuinely self-signed certificate, a certificate signed by a private intercepting CA, and a certificate whose validity window had already closed all produced that identical string. Setting ignoreHTTPSErrors: true made all three load, and the certificates they presented were still the same three different certificates afterwards. BotBrowser can hold browser and profile inputs consistent while a test examines that difference, but it does not decide whether a chain is trusted, does not install a certificate authority, and cannot make an ignored error equivalent to a valid chain.
That is the whole argument in one paragraph. The error text is a symptom shared by at least three different faults, so a fix chosen from the error text alone is a guess. The certificate the browser received is the evidence that separates them, and it is readable before any launch option is changed.
The fixtures here are local and owned: certificates generated with OpenSSL, served on 127.0.0.1, opened with Playwright driving an installed Chrome build. Nothing from a third-party site is reproduced, no private key is published, and no technique for defeating another party's security control appears. When the question is how a browser decides to trust a chain at all, the TLS certificate and connection trust article covers that layer; when the failure is really a routing problem, Playwright proxy configuration owns it.
TL;DR
- One error string,
net::ERR_CERT_AUTHORITY_INVALID, was produced by three different faults in three owned fixtures. - The certificate the browser received distinguishes them: a self-signed leaf has subject equal to issuer, a proxy CA leaf has a different issuer, and an expired leaf shows a validity window in the past.
ignoreHTTPSErrors: truechanges whether the navigation completes. It does not change what the certificate says or make the chain trusted.- Read the certificate before changing a launch option, otherwise the option records a decision nobody verified.
- A document can still report
https:andisSecureContext: truewhile its chain is untrusted, so neither value is evidence about trust. - BotBrowser keeps browser-side inputs consistent for that investigation; it does not arbitrate trust, install a CA or validate a chain for you.
Table of contents
- One error string, three owned fixtures
- Read the certificate the browser received
- What ignoring the error does and does not change
- The three-cause decision table
- Why the page cannot answer this question
- BotBrowser capability and limitation
- Practical conclusion
One error string, three owned fixtures
When the same certificate check runs inside Playwright MCP, the option lives in the MCP config rather than in a launch flag: the MCP ignoreHTTPSErrors placement traces which config object carries it and what stays unvalidated.
The same split applies in the other direction when a server asks for a certificate from the client: the Playwright client certificate errors page shows the exact-origin rule and the three client-side causes behind one mutual-TLS refusal.
The run used Playwright 1.58.0 driving an installed Chrome build, with OpenSSL 4.1.0 generating three fixtures on the local host. Each fixture served the same trivial document, so the only variable was the certificate.
The first fixture is a genuine self-signed certificate: one key pair, one certificate, subject and issuer both owned.test. The second is a leaf signed by a private certificate authority created for this test, with subject proxy.owned.test and issuer Owned Intercept CA, which is the shape a TLS-terminating proxy produces. The third is a leaf from that same private CA but re-signed with a validity window entirely in the past, from 1 January 2020 to 1 February 2020.
All three navigations failed, and all three printed:
page.goto: net::ERR_CERT_AUTHORITY_INVALID at https://127.0.0.1:9441/
page.goto: net::ERR_CERT_AUTHORITY_INVALID at https://127.0.0.1:9442/
page.goto: net::ERR_CERT_AUTHORITY_INVALID at https://127.0.0.1:9443/
Only the port differs. A run that logs the error and nothing else has recorded that three unrelated faults occurred without recording which one it hit. That is why the next step is not a launch flag.
Read the certificate the browser received
Playwright exposes the negotiated connection through response.securityDetails() on the response object returned by page.goto(). It reports the protocol, the subject name, the issuer and the validity window. The fields below come from the three fixtures in this run:
const browser = await chromium.launch({ executablePath: chromePath });
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
const response = await page.goto('https://127.0.0.1:9442/');
const security = await response.securityDetails();
console.log(security.protocol, security.subjectName, security.issuer);
console.log(new Date(security.validFrom * 1000).toISOString(), new Date(security.validTo * 1000).toISOString());
The readback separates the fixtures immediately:
| Fixture | subjectName | issuer | validFrom | validTo |
|---|---|---|---|---|
| self-signed | owned.test | owned.test | 2026-11-23T20:38:07.000Z | 2026-12-23T20:38:07.000Z |
| proxy CA | proxy.owned.test | Owned Intercept CA | 2026-11-23T20:38:07.000Z | 2026-12-23T20:38:07.000Z |
| clock skew | expired.owned.test | Owned Intercept CA | 2020-01-01T00:00:00.000Z | 2020-02-01T00:00:00.000Z |
Three questions read off that table, in order:
- Is the subject the same as the issuer? If yes, the endpoint presented its own certificate as an authority. That is the self-signed case.
- If the issuer differs, who signed it? A private or unfamiliar authority name is the proxy-CA case: something in the path re-signed the connection rather than presenting the server's own chain.
- Is the validity window consistent with the current date? A window entirely in the past, or a start date in the future, is the clock case. The certificate is well formed and correctly signed; its validity does not overlap now.
None of those three questions is answerable from ERR_CERT_AUTHORITY_INVALID. All three are answerable from the readback, and the readback costs one call on a response you already have.
The values are evidence about this run only. They describe the local fixtures on this host at this time, and a reviewer should not treat the exact timestamps as a general fact about certificate errors.
What ignoring the error does and does not change
Re-running the same three fixtures with ignoreHTTPSErrors: true changed the navigation outcome: the self-signed fixture and the expired fixture both loaded and rendered their title and heading.
The certificate did not change. Reading securityDetails() in the permitted run returned the same subject, issuer and validity window as the failed run, because the connection carried the same certificate either way. What changed is whether the browser was willing to complete the navigation with an untrusted chain.
The page-side values are equally unhelpful as trust evidence. In the ignored run the document reported:
location.protocol: https:
window.isSecureContext: true
Both are true and both are consistent with an untrusted chain. https: says which scheme was requested; isSecureContext describes the privileges the document gets. Neither says the chain validated. A test that asserts on either value after enabling ignoreHTTPSErrors is asserting on something the option did not touch.
That is the practical distinction the option makes. ignoreHTTPSErrors is a policy about proceeding, not a repair of the certificate. If the goal is to test a page over a self-signed test origin, the option is a deliberate, recorded policy choice. If the goal is to find out why a run cannot reach a host, the option removes the only signal that was pointing at the problem.
The three-cause decision table
Use this table before touching a launch option. Each row is decided from the certificate readback, not from the error string.
| Readback observation | Cause | What the option would do | What it would not do |
|---|---|---|---|
| subject equals issuer | The endpoint presented its own certificate | Let the navigation proceed with an untrusted chain | Make the endpoint's certificate trusted |
| issuer is a private or unexpected CA | Something in the path re-signed the connection | Let the navigation proceed past that chain | Explain who inserted the certificate or why |
| validity window does not include now | Validity and clock disagree | Let the navigation proceed anyway | Correct the clock or extend validity |
The second row deserves its own attention. A proxy that terminates TLS with its own authority produces a perfectly well-formed chain; the failure is that the client does not trust that authority. Adding the authority to a test client's trust store is a different decision from ignoring the error, and it has a different scope: trust is a property of the client's configuration, while the option is a property of one context. A test that wants to verify behavior over a proxy CA should say so explicitly and record which authority it trusted.
The third row is the one most often misdiagnosed as a certificate problem. A certificate with a validity window in the past is not malformed. On an owned fixture, re-signing with a current window fixes the fixture. On someone else's host, an expired window is information about that host, and the correct action is to report it rather than to suppress the client-side check.
Why the page cannot answer this question
It is tempting to make the document report something about the certificate and assert on that. The run shows why that does not work: the page sees https: and a secure context in both the trusted-intent and untrusted cases. Certificate chain state is a client-side decision; by the time a document runs, the decision has already been made and the document is not told the outcome in a queryable form.
That leaves three distinct evidence classes, and mixing them is the recurring error in this kind of diagnosis:
| Evidence class | Who produces it | What it establishes |
|---|---|---|
| Navigation error | The automation client | That the client refused to proceed |
| Certificate readback | The client's view of the negotiated connection | Which certificate was presented and by whom |
| Page observation | A script in the document | What the page reports after the decision |
The middle row is the decisive one and the one most often skipped. The first row is necessary but not sufficient, because it is shared across causes. The third row cannot speak to trust at all.
What the readback costs and what it misses
The readback costs one call on a response you already hold, but it is not a complete chain inspection. securityDetails() reports the leaf the browser negotiated plus the protocol and validity window; it does not enumerate every intermediate certificate, and it does not report which root anchor the client would have used had the chain validated. That gap matters for the proxy case, because a chain can fail for a reason above the leaf: an unknown intermediate, a name constraint, or an authority the client does not have.
For the three fixtures here the leaf was enough, because each cause was visible at the leaf. A reviewer working on a live deployment should therefore treat a matching readback as the first discriminator and not as a final verdict. If the leaf looks normal and the navigation still fails, the next question is about the chain above it, and that question belongs to whoever owns the client's trust configuration.
There is also a cost in what a passing readback hides. When the navigation completes because the error is ignored, securityDetails() still returns the same values, so a log that records only "navigation succeeded" has thrown away the one field that would have shown the connection was never validated. Recording the readback beside the outcome keeps that distinction available later.
Reproducing the fixtures without touching a real host
The three fixtures are small enough to rebuild. A self-signed certificate comes from one openssl req -x509 call with a single key pair. A proxy-shaped chain comes from a second openssl req -x509 for the authority, a key and certificate-signing request for the leaf, and openssl x509 -req to sign the leaf with that authority. The expired leaf reuses the same signing request and is re-signed with an explicit validity window in the past.
Two practical notes belong with the recipe. First, the subject name must match what the client expects, or the failure becomes a name mismatch and the exercise loses its point; using 127.0.0.1 as the host and a matching subject keeps the certificate error the only variable. Second, the fixture certificates are throwaway material for a local test, which is why no key or authority file from this run is published and why the values in the table are tied to one host and one timestamp.
Finally, sequence the run so the readback is captured before any option changes. Capturing it afterwards, with the error already suppressed, is possible, but it invites one specific mistake: treating a completed navigation as evidence that the certificate question was answered.
BotBrowser capability and limitation
BotBrowser documents profile-backed browser surfaces and explicit launch inputs, including how a test points the browser at the certificate handling it intends to use, and that capability keeps browser-side inputs consistent while a reviewer repeats the readback across the three fixtures, so a difference between runs comes from the certificate rather than from a drifting profile. The limitation belongs in the same paragraph: BotBrowser does not decide whether a chain is trusted, does not install a certificate authority for you, does not alter the certificate a server presents, and cannot make a run with an ignored error equivalent to a run over a valid chain. The TestOptions reference documents ignoreHTTPSErrors as a client-side option; the BotBrowser network documentation documents the network configuration surfaces a profile controls. Neither turns a suppressed error into a validated chain.
FAQ
Does ERR_CERT_AUTHORITY_INVALID mean the certificate is self-signed?
No. It means the client could not validate the chain to a trusted authority. In this run a genuinely self-signed certificate, a private-CA certificate and an expired certificate all produced the same error string. The certificate readback separates them.
Is ignoreHTTPSErrors: true a fix?
It is a policy that lets the navigation proceed over an untrusted chain. It does not change the certificate, does not add an authority to a trust store, and does not make the connection validated. Use it when proceeding is the intended test condition and record that decision.
Why does the page still report https: and a secure context?
Because those values describe the scheme and the privileges of the document, not the validation result. Both were reported in this run while the chain was untrusted.
How do I tell a proxy CA from a host certificate?
Read securityDetails() and compare the issuer. A host that presents its own certificate has subject equal to issuer; a terminating proxy presents a leaf whose issuer is the proxy's authority. The issuer name is the field that separates the two cases.
Can a clock problem be fixed by ignoring the error?
Ignoring the error lets the navigation complete, but the validity window is still inconsistent with the clock. On an owned fixture, re-sign with a current window. On a host you do not control, report the mismatch instead of suppressing the check.
For neighboring work, TLS certificates and browser connection trust explains how a chain is built and validated, and Playwright proxy configuration covers routing rules when the failure is a path problem rather than a certificate one.
Sources
Practical conclusion
One error string covered three different faults in this run: a self-signed endpoint, a private intercepting authority and a validity window in the past. The certificate the browser received separated them through subject, issuer and validity window, and that readback is available from the response you already have. ignoreHTTPSErrors: true changed whether the navigation completed and left the certificate unchanged, so it is a recorded policy choice rather than a diagnosis. Read the certificate first, name which of the three causes you have, and then decide whether proceeding is the condition you actually want to test.
This article is part of the guide: Browser Automation Getting Started: A First Run Map
Related Articles
Playwright MCP: Where ignoreHTTPSErrors Belongs
Getting StartedPlaywright Client Certificate Errors: Three Causes
NetworkTLS Certificates and Browser Connection Trust
Getting StartedPlaywright Strict Mode Violation: Fix Duplicate Matches
Getting StartedBrowser Automation Test Fixtures and Isolation
Getting StartedPlaywright Test Timeout: Which Budget Expired?
Run the same check in BotBrowser
Load a profile, keep the signals you just read about consistent inside the browser, and confirm the result on your own machine before a rollout.