Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ignore_https_errors sometimes does not take effect #32801

Open
harlansgs opened this issue Sep 24, 2024 · 1 comment
Open

[Bug]: ignore_https_errors sometimes does not take effect #32801

harlansgs opened this issue Sep 24, 2024 · 1 comment

Comments

@harlansgs
Copy link

Version

1.47.0

Steps to reproduce

from playwright.async_api import async_playwright
import asyncio
import tempfile


async def main():
    async with async_playwright() as p:
        with tempfile.TemporaryDirectory() as profile1, \
             tempfile.TemporaryDirectory() as profile2:
            # Launch first persistent context
            browser1 = await p.chromium.launch_persistent_context(user_data_dir=profile1, ignore_https_errors=False)
            page1 = await browser1.new_page()
            await page1.goto('https://example.com')

            # Launch second persistent context
            browser2 = await p.chromium.launch_persistent_context(user_data_dir=profile2, ignore_https_errors=True)
            page2 = await browser2.new_page()

            # In rare cases: ignore_https_errors will fail, throwing the error
            await page2.goto('https://untrusted-root.badssl.com/')

            await browser1.close()
            await browser2.close()

Expected behavior

Second browser context with ignore_https_errors=True should navigate to the target page without error.

Actual behavior

In very rare cases, we see the second browser context's ignore_https_errors flag fail. This results in an ERROR: unable to verify the first certificate.

Additional context

We had been using Playwright 1.36.0 for quite some time, and recently updated to 1.47.0. We are now seeing this bug (very rarely) with the new default Chromium version 129.0.6668.29. As described in the reproduction example, we are using the async Playwright bindings and launching two persistent Chromium contexts. This is not a major issue for us, so just wanted to check in here and see if there might have been some known change here for certificate parsing in Chromium/Playwright?

Environment

- Operating System: [Ubuntu 22.04]
- CPU: [x86]
- Browser: [Chromium]
- Python Version: [3.9]
- Other info:
@harlansgs harlansgs changed the title [Bug]: [Bug]: ignore_https_errors sometimes does not take effect Sep 24, 2024
@mxschmitt mxschmitt transferred this issue from microsoft/playwright-python Sep 25, 2024
@mxschmitt
Copy link
Member

I was not able to reproduce. Did this script surface the error for you? Usually browser https errors look different, e.g.

Page.goto: net::ERR_CERT_AUTHORITY_INVALID at https://untrusted-root.badssl.com/

Are you maybe doing request interception with page.route?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants