title: Puppeteer/Chromium proxy ERR_TUNNEL_CONNECTION_FAILED
body: <p>I want to use puppeteer inside docker but got an error with the https version of any websites</p>
  <p>My dockerfile:</p>
  <pre><code>FROM node:14.8.0-slim
  
  ENV http_proxy http://10.156.10.155:3128
  ENV https_proxy http://10.156.10.155:3128
  
  RUN apt-get update \
      &amp;&amp; apt-get install -y wget gnupg \
      &amp;&amp; wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
      &amp;&amp; sh -c 'echo &quot;deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main&quot; &gt;&gt; /etc/apt/sources.list.d/google.list' \
      &amp;&amp; apt-get update \
      &amp;&amp; apt-get install -y nano vim google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
        --no-install-recommends \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  RUN npm config set proxy http://10.156.10.155:3128
  RUN npm config set https-proxy http://10.156.10.155:3128
  RUN npm i puppeteer@5.2.1
  
  ADD screenshot.js /app/screenshot.js
  
  RUN groupadd -r pptruser &amp;&amp; useradd -r -g pptruser -G audio,video pptruser
  RUN chown -R pptruser:pptruser /app
  
  
  USER pptruser
  
  WORKDIR /app
  # CMD [&quot;node&quot;, &quot;index.js&quot;]
  </code></pre>
  <p>And screenshot.js:</p>
  <pre><code>const puppeteer = require('puppeteer');
  
  (async () =&gt; {
    const browser = await puppeteer.launch({
      headless: true,
      ignoreHTTPSErrors: true,
      args: ['--disable-dev-shm-usage', 
        '--proxy-server=http://10.156.10.155:3128',
        '--no-sandbox',
        '--disable-setuid-sandbox'
  
      ]
    });
  
    const page = await browser.newPage();
    await page.setUserAgent('Mozilla/5.0 (Windows NT 6.1; rv:60.7) Gecko/20100101 Firefox/60.7');
    await page.goto('https://example.com');
    await page.screenshot({path: 'example.png'});
  
    await browser.close();
  })().catch(error =&gt; console.trace(error));
  </code></pre>
  <p>I have no error for <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a>, but i have this error for the https version:</p>
  <pre><code>Trace: Error: net::ERR_TUNNEL_CONNECTION_FAILED at https://example.com
      at navigate (/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:113:23)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
      at async FrameManager.navigateFrame (/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:88:21)
      at async Frame.goto (/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:405:16)
      at async Page.goto (/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:826:16)
      at async /app/screenshot.js:19:3
      at /app/screenshot.js:23:29
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  </code></pre>
  <p>I've tried settings http_proxy and https_proxy env, without any success.</p>
  <p>I've just tried without docker, and same thing, so not related to docker :/</p>
  <p>Do you have any idea ?</p>