How to Fix net::ERR_CERT_AUTHORITY_INVALID in Playwright

You might be facing the error that says net::ERR_CERT_AUTHORITY_INVALID at <URL>. For that, you have to just ignore HTTPS errors in Playwright. The SSL certificate error can be bypassed if we just use an existing functionality setting, ignoreHTTPSErrors. Want to learn How to Fix net::ERR_CERT_AUTHORITY_INVALID in Playwright? Go ahead dive in this tutorial.

Let’s say you are trying to do a simple Playwright test like this, which is basically navigating to a dashboard page of a URL that has an expired or disabled certificate, and then we are waiting for something to be visible.

Now, when you try to run this test, the URL that hits shows this message:

net::ERR_CERT_AUTHORITY_INVALID at <URL>

your connection is not private image

If you were to click on the Advanced button manually, it will further explain that:

This server could not prove it is <URL>; its security certificate is not trusted by your computer’s operating system. This may be caused by a misconfiguration or an attacker intercepting your connection.

Proceed to <URL> (unsafe)

Technically, manually, you have no other option but to either proceed trusting this website right or click the Back to safety button to just close everything.

Here’s a joke from https://programmerhumor.io

Steps on How to Fix net::ERR_CERT_AUTHORITY_INVALID in Playwright

Fairly easy if you follow these steps to resolve such certificate issues in Playwright:

Step 1: Navigate to your playwright.config.ts file and look for the section use: {}

Step 2: Start typing ignoreHTTPSErrors, and you will notice the property showing up, (might not with Javascript)

suggestion image for How to Fix net::ERR_CERT_AUTHORITY_INVALID in Playwright

Even so, basically, you have to make ignoreHTTPSErrors: true, that’s it!

use: {
ignoreHTTPSErrors: true
}

Once added, that section would look something like this:

solution for How to Fix net::ERR_CERT_AUTHORITY_INVALID in Playwright image

Step 3: Run your test and this time around you will notice when the said url is hit, you will be going past that screen and not getting stuck at the error “Your Connection is private” error screen.

As simple as that!

Why Does Playwright Crash When This Certificate Error Appears?

When Playwright tries to open a website with an invalid, expired, or untrusted SSL certificate, the browser blocks the connection for security reasons. Instead of loading the actual webpage, Chromium shows a warning page and throws the following error in the terminal:

net::ERR_CERT_AUTHORITY_INVALID

Since the page never loads successfully, Playwright cannot continue interacting with elements on the website. This often causes automation scripts to fail, timeout, or crash entirely during navigation.

This usually happens when:

  • the SSL certificate has expired,
  • the certificate is self-signed,
  • the certificate authority is not trusted,
  • or the HTTPS configuration is incorrect.

To bypass this in testing or automation environments, Playwright provides the ignoreHTTPSErrors option, which tells the browser to continue loading the website even when certificate warnings appear.

Using ignoreHTTPSErrors in Playwright is an easy way to bypass SSL and certificate-related issues during automation. This is especially useful in staging, QA, or internal environments where self-signed or expired certificates are common.

Production Warning:

  • Avoid using ignoreHTTPSErrors in production environments unless absolutely necessary.

Found this tutorial helpful? Explore more Playwright tutorials on our website.

New to Playwright? Here’s a tutorial on Getting started with Playwright

Scottshak

Poet. Author. Blogger. Screenwriter. Director. Editor. Software Engineer. Author of "Songs of a Ruin" and proud owner of four websites and two production houses. Also, one of the geekiest Test Automation Engineers based in Ahmedabad.

You may also like...

Leave a Reply