cazala / coin-hive

CoinHive cryptocurrency miner for node.js
https://www.npmjs.com/package/coin-hive
MIT License
1.98k stars 400 forks source link

SSL Certificate error: ERR_CERT_AUTHORITY_INVALID #86

Closed Jefreesujit closed 6 years ago

Jefreesujit commented 6 years ago

Hi, I m just trying to use the coinhive with the sample code provided in the example.

I m getting the following error:

(node:24147) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: SSL Certificate error: ERR_CERT_AUTHORITY_INVALID (node:24147) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Jefreesujit commented 6 years ago

Found a fix for this, passing ignoreHTTPSErrors will resolve this issue

const miner = await CoinHive('fA49gxp1U8UxDqf7ZqMECVJ1WwjocaFh', { launch: { args: ['--disable-setuid-sandbox', '--no-sandbox'], waitUntil: 'networkidle', ignoreHTTPSErrors: true } });