puppeteer: [Bug]: Chromium download over http proxy fails

Bug description

Steps to reproduce the problem:

  1. Have a proxy server setup, and set HTTP_PROXY and HTTPS_PROXY environment variables to point to it, both as http:// urls.
  2. Install puppeteer
  3. Download of Chromium during install fails with ERR_INVALID_PROTOCOL

It appears that this is happening because we are proxying HTTPS over an HTTP proxy.

Puppeteer version

5.5.0

Node.js version

16.9.1

npm version

7.21.1 (but we use yarn, version 1.22.5)

What operating system are you seeing the problem on?

Linux

Relevant log output

2021-09-23T19:25:57.805Z puppeteer:fetcher Downloading binary from https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/818858/chrome-linux.zip
ERROR: Failed to set up Chromium r818858! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at Object.request (node:https:353:10)
    at httpRequest (<REDACTED>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:488:17)
    at downloadFile (<REDACTED>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:357:21)
    at BrowserFetcher.download (<REDACTED>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:239:19)
    at async downloadBrowser (<REDACTED>/node_modules/puppeteer/lib/cjs/puppeteer/node/install.js:48:5) {
  code: 'ERR_INVALID_PROTOCOL'
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 19 (1 by maintainers)

Commits related to this issue

Most upvoted comments

We’re marking this issue as unconfirmed because it has not had recent activity and we weren’t able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.