New issue
Advanced search Search tips

Issue 786851 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 721739
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

When use headless mode, got Failed Provisional Load error [error_code: -501, error_description: , showing_repost_interstitial: 0, frame_id: 1]

Reported by wenzhany...@gmail.com, Nov 20 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. Use selenium build the driver:
const chromeCapabilities = webdriver.Capabilities.chrome();
        const chromeOptions = {
          args: ['headless', 'window-size=1400,1000', '--disable-gpu',
            '--enable-logging',
            '--v=1',
            '--ignore-certificate-errors',
          ]
        };
        chromeCapabilities.set('acceptSslCerts', true);
        chromeCapabilities.set('chromeOptions', chromeOptions);
        this.driver = new webdriver.Builder()
          .forBrowser('chrome')
          // .setProxy(proxyConfig)
          .withCapabilities(chromeCapabilities)
          .build();
and the base url is: https://localhost/home.

2. When run the script.

What is the expected behavior?
The page will load and run other scripts.

When use normal mode(no headless) is work well.
const chromeCapabilities = webdriver.Capabilities.chrome();
const chromeOptions = {
          args: ['--test-type', '--start-maximized']
        };
chromeCapabilities.set('acceptSslCerts', true);
chromeCapabilities.set('chromeOptions', chromeOptions);
this.driver = new webdriver.Builder()
          .forBrowser('chrome')
          .withCapabilities(chromeCapabilities)
          .build();

What went wrong?

The page not load: https://localhost/home
09:24:07.722 DEBUG selenium-nodejs.HomePage: navigate
[1120/092408.090:VERBOSE1:network_delegate.cc(31)] NetworkDelegate::NotifyBeforeURLRequest: https://localhost/home
[1120/092408.403:VERBOSE1:navigator_impl.cc(242)] Failed Provisional Load: https://localhost/home, error_code: -501, error_description: , showing_repost_interstitial: 0, frame_id: 1

Did this work before? No 

Chrome version: 62.0.3202.94  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Components: -Enterprise Internals>Network>Certificate Internals>Headless
-501 is ERR_INSECURE_RESPONSE.
Have a solution to ignore the Certificate now? Or other solution?

Thanks a lot!

Comment 3 by mattm@chromium.org, Nov 22 2017

Labels: Needs-Feedback
I'm not familiar with selenium, but I wonder if the problem is that you have "--" in front of some of the args array and not others? Maybe it expects you to specify args with no -- in front?

Alternatively you could try --allow-insecure-localhost, which appears should work in headless:
https://cs.chromium.org/chromium/src/headless/lib/browser/headless_content_browser_client.cc?rcl=26ebf15fcb6f642fb7c0d19ceb3fd6df2918c7dd&l=305

Let us know if either of those helps.
Thanks a lot. 
Use args "--allow-insecure-localhost" the localhost Certificate 
 problem resolved. 
But how to ignore the Certificate when the url is not localhost?
[1123/103500.920:VERBOSE1:navigator_impl.cc(242)] Failed Provisional Load: https://10.175.192.123/home, error_code: -118, error_description: , showing_repost_interstitial: 0, frame_id: 1
Project Member

Comment 6 by sheriffbot@chromium.org, Nov 23 2017

Cc: mattm@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "mattm@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by mattm@chromium.org, Nov 23 2017

Mergedinto: 721739
Status: Duplicate (was: Unconfirmed)
Looks like there isn't a way currently. If you want to use non-localhost certs I guess  issue 721739  is the one to track.


(I was going to suggest --ignore-certificate-errors-spki-list but it looks like headless mode using the default CertVerifier from UrlRequestContextBuilder: https://cs.chromium.org/chromium/src/headless/lib/browser/headless_url_request_context_getter.cc?rcl=11cab721ee2309a9adfa496a047afe2add401059&l=86

So --ignore-certificate-errors-spki-list probably won't work with headless mode either.)

Sign in to add a comment