playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] playwright throwing SSL while ignoreHTTPSErrors is true

Open vdhpieter opened this issue 5 years ago • 6 comments

Context:

  • Playwright Version: 1.14.1
  • Operating System: Linux
  • Node.js version: 16
  • Browser: Chromium
  • Extra: running in docker-compose

Code Snippet

import { expect, test } from '@playwright/test';

const testUrl = process.env.TEST_URL;

test('Smoke test', async ({ page }) => {
  await page.goto(testUrl);
  const title = page.locator('h1');

  await expect(title).toHaveText('Login');
});

Describe the bug

I have some trouble with playwright and docker compose. So i run my app in one docker container and my playwright tests from another container. I connect to my app using docker routing so http://[container-name]:[port-number] in my case: http://app:3000. I always get a page.goto: net::ERR_SSL_PROTOCOL_ERROR at http://app:3000/ . Any other way I run my tests (with no docker container, with running the app in a container and the tests just from my mac….) works like expected.

In my config I have ignoreHTTPSErrors: true but still get these errors.

vdhpieter avatar Oct 05 '21 13:10 vdhpieter

Is there a script I can run or steps I can follow to reproduce this issue? I am not too familiar with docker compose.

JoelEinbinder avatar Oct 05 '21 14:10 JoelEinbinder

We found the solution, it is because our docker compose service was called app just renaming it something else works :shrug:

When the solution was found one of my teammates remembered they had the same problem before with another framework. So it’s not related to playwright!

Thx for the quick responses anyway!

vdhpieter avatar Oct 06 '21 09:10 vdhpieter

I had the same problem when i tried to connect to a container named dev in my docker-compose setup.

I suspect this is because of the https TLD restrictions by google for .app and .dev, see

https://help.dreamhost.com/hc/en-us/articles/360025832811--dev-and-app-domains-force-HTTPS-by-default

mkbrechtel avatar Apr 30 '23 14:04 mkbrechtel

Maybe worth a try to get it fixed in Chromium because I think Google is unlikely to host anything on https://app or https://dev and their restriction clearly seems to be aiming at subdomains.

silverwind avatar Mar 13 '24 14:03 silverwind

I had the same problem when i tried to connect to a container named dev in my docker-compose setup.

I suspect this is because of the https TLD restrictions by google for .app and .dev, see

https://help.dreamhost.com/hc/en-us/articles/360025832811--dev-and-app-domains-force-HTTPS-by-default

Thanks, you saved my day!

r34son avatar Apr 12 '24 23:04 r34son

For whatever reason this issue was happening now for me after upgrading from playwright 1.58.2 to 1.59.1. Thanks @mkbrechtel for the workaround !!

bormm avatar Apr 16 '26 13:04 bormm