gajus / puppeteer-proxy

Proxies Puppeteer Page requests.
Other
197 stars 24 forks source link

Doesn't support HTTPS #6

Closed Bouzazi closed 4 years ago

Bouzazi commented 4 years ago

Works fine with HTTP Redirecting HTTPS to HTTP Am i missing something?

gajus commented 4 years ago

It certainly works as I am using it for https sites.

You will need to provide more context.

Bouzazi commented 4 years ago

Thanks for the quick reply I'm using the same GET example provided in README with an http proxy bought from proxiware on an HTTPS website, on https://www.howsmyssl.com/ to be exact. It redirects me to HTTP and tells me that I'm not using a secure connection.

import puppeteer from 'puppeteer';
import {
  proxyRequest,
} from 'puppeteer-proxy';

(async () => {
  const browser = await puppeteer.launch({headless: false});
  const page = await browser.newPage();

  await page.setRequestInterception(true);

  page.on('request', async (request) => {
    await proxyRequest({
      page,
      proxyUrl: 'http://us.proxiware.com:3000',
      request,
    });
  });

  await page.goto('https://www.howsmyssl.com/');
})();

and I should mention that I'm running it with esm on node

gajus commented 4 years ago

Make sure you have NODE_TLS_REJECT_UNAUTHORIZED=0.

Bouzazi commented 4 years ago

Same result with a warning

(node:6172) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

gajus commented 4 years ago

¯\(ツ)

If you can replicate the issue consistently, then fixing it and writing a test case for it should be easy.

Bouzazi commented 4 years ago

I don't know where to start, I'm facing the same issue with this module too puppeteer-page-proxy I'm sure it has nothing to do with the proxy itself because It works fine with HTTPS when I use the usual browser implementation.

const browser = await puppeteer.launch({headless: false, args: ['--proxy-server=http://us.proxiware.com:3021']});

and what makes me more indignant is this. Certificate is valid and trusted, all the resources are too. but, It's still showing that my connection is not secure.