apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
https://www.npmjs.com/package/proxy-chain
Apache License 2.0
841 stars 141 forks source link

Error: net::ERR_SSL_PROTOCOL_ERROR #43

Closed terion-name closed 2 years ago

terion-name commented 5 years ago

I get Error: net::ERR_SSL_PROTOCOL_ERROR when trying to access https site via http socket

puppeteer.launch({
    headless: true,
    args: [
      `--window-size=${ua.data.viewportWidth},${ua.data.viewportHeight + windowFrame}`,
      `--proxy-server=${await proxyChain.anonymizeProxy(getRandomProxy())}`,
    ]
  }).then(async browser => {
const page = await browser.newPage();
await page.goto('https://some-site.com/'), {waitUntil: 'networkidle0'};
})

It seems that error is happening when site has Let'sEncrypt's cert, accessing sites with comodo certs (e.g. https://www.myip.com/) works

terion-name commented 5 years ago

verbose:

Server[4567]: 1 | !!! Handling CONNECT some-site.com:443 HTTP/1.1
Server[4567]: 1 | Using upstream proxy http://user:<redacted>@<ip-address-here>:9257/
Server[4567]: 1 | Using HandlerTunnelChain
Server[4567]: 1 | Connecting to upstream proxy...
Server[4567]: 1 | Target socket assigned
Server[4567]: 1 | Connected to upstream proxy
Server[4567]: 1 | Target socket ended
Server[4567]: 1 | Target socket closed
(node:16613) UnhandledPromiseRejectionWarning: Error: net::ERR_SSL_PROTOCOL_ERROR at https://some-site.com/
jancurn commented 5 years ago

Thanks for reporting this, looks like some bug in handling SSL errors. We'll look into it - or pull requests are welcome.

pocesar commented 5 years ago

@jancurn the places-crawler actor isn't working because of this (when using the Google SERP proxy group)

jancurn commented 5 years ago

@pocesar It seems you were using the Apify Proxy's GOOGLE_SERP proxy group when running the Google Places Scraper actor. Unfortunately, the GOOGLE_SERP proxy group only supports queries to Google Search and Google Shopping, but not to Google Maps. And since you're connecting over SSL (to https://maps.google.com), Apify Proxy has no way to respond back with an error to tell you about this, and the connection only fails with an SSL error like you're getting.

Just make sure you're not using GOOGLE_SERP proxy group, that's all.

jancurn commented 5 years ago

@terion-name We've checked it and the Let's Encrypt certificates are normally supported. Perhaps your system didn't have Let's Encrypt in their root certificates? Can you try to connect to the server directly without the proxy to see if the error is still there?

jancurn commented 5 years ago

Please, can you test it again with the new release 0.3.2?

terion-name commented 5 years ago

@jancurn got a pause with project where this issue occurred, retuning to it, will test soon, thank you

wizehood commented 4 years ago

Any update about this? I get the exact same issue when using proxies with special characters inside the proxy URL (containing password with percentage(%) for example etc)

Thanks

jancurn commented 4 years ago

@wizehood please can you provide more examples or ideally some sort of reproduction case?

wizehood commented 4 years ago

@jancurn I'm getting this with my client who got credentials from a 3rd party proxy provider. The provisionary URL goes something like this: http://customer-marktwain-session-60-sessionid-12345:passw%rd@proxy.cloud:1234

It seems like special character inside the password creates an issue for this specific proxy string. Note that I didn't have problems before with digit/char/dash mixed passwords before.

nick-loginov commented 3 years ago

Getting this error too while navigating https site

vadymhimself commented 3 years ago

Same here

szmarczak commented 2 years ago

The % character needs to be percent-encoded as %25.