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
IgnoreHTTPSErrors only sometimes works? #2485
Comments
Using the following script, I'm able to reproduce it, you can see it ran fine 3 times, then on the 4th.. Using
Tested with playwright #!/usr/bin/python3
from playwright.sync_api import sync_playwright
import playwright._impl._api_types
# pip3 install playwright
# docker run -d --name browserless --rm -p 3000:3000 --shm-size="2g" browserless/chrome:1.53-chrome-stable
def letsgo():
print ("Trying...")
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp('ws://127.0.0.1:3000/?ignoreHTTPSErrors=true&stealth=1&--disable-web-security=true', timeout=10000)
context = browser.new_context(
bypass_csp=True,
service_workers='block',
accept_downloads=False
)
page = context.new_page()
page.on("console", lambda msg: print(f"Playwright console: Watch URL: {msg.type}: {msg.text} {msg.args}"))
page.goto("https://untrusted-root.badssl.com/", wait_until='commit')
page.wait_for_timeout(1 * 1000)
context.close()
browser.close()
if __name__ == '__main__':
while True:
letsgo() Here
|
Sorry for the delay on these few. I ran some tests with both browserless and const newPage = async (browser, url) => {
const page = await browser.newPage();
return page.goto(url).catch((err) => {
if (err.message.includes("ERR_SSL_PROTOCOL_ERRO")) {
const urlObj = new URL(url);
urlObj.protocol = "http";
return page.goto(urlObj.href);
}
throw err;
});
};
const page = await newPage(browser, "https://200.55.247.6:3000/"); |
Closing this one for lack of activity. Let us know if we should reopen it! |
Describe the bug
It looks like sometimes browserless doesn't launch chrome with the
ignoreHTTPSErrors
flag even though it's specified in thedocker-compose.yml
file and/or using the URL parameter.To Reproduce
In my
docker-compose.yml
:Python script using playwright:
Expected behavior
Browserless should be instructing chrome to ignore HTTPS certificate errors if
DEFAULT_IGNORE_HTTPS_ERRORS=true
is specified through docker or via the connection URL .Screenshots
First run of the Python script everything is fine:
Third time running the script, certificate error is thrown when calling
page.goto()
:Additional context
Currently working around this by catching any error with
CERT
in the string and callingpage.goto()
again (line 35-40 in the python script, no clue why this works). Obviously this isn't ideal, chrome should be ignoring cert errors everytime it gets started if the correct knobs are turned.The text was updated successfully, but these errors were encountered: