christopherwk210 / site-scan

CLI for capturing website screenshots, powered by puppeteer.
MIT License
136 stars 13 forks source link

Add option to ignore SSL errors #6

Closed eschultze closed 6 years ago

eschultze commented 6 years ago

First of all thanks for your project!

Sometimes screenshots will fail if the SSL certificate was not issued by a CA or if it's expired. This example is a phishing website from Phishtank.

$ sitescan http://flordeyd.beget.tech/hopz/6dbc4//
• Launching chrome...
✔ Done.

• Loading http://flordeyd.beget.tech/hopz/6dbc4//...
• Error loading http://flordeyd.beget.tech/hopz/6dbc4//
(node:6098) UnhandledPromiseRejectionWarning: Error: SSL Certificate error: ERR_CERT_DATE_INVALID
    at NavigatorWatcher.waitForNavigation (/usr/local/lib/node_modules/site-scan/node_modules/puppeteer/lib/NavigatorWatcher.js:73:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:6098) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6098) [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.

I wanted to help more but my node and js knowledge is not very good.

Check these links if you don't mind: https://github.com/GoogleChrome/puppeteer/issues/1088 https://github.com/GoogleChrome/puppeteer/issues/1137 https://github.com/GoogleChrome/puppeteer/issues/84

christopherwk210 commented 6 years ago

Fixed in 04e88221714c08341ee3df890ea3ca74996d0f86 👍