fzaninotto / uptime

A remote monitoring application using Node.js, MongoDB, and Twitter Bootstrap.
http://fzaninotto.github.com/uptime/
MIT License
3.62k stars 706 forks source link

ignore ssl cert problems #284

Open caclifton opened 9 years ago

caclifton commented 9 years ago

Trying to get uptime to ignore ssl cert problems on ssl checks. Have tried adding rejectUnauthorized : false in the http plugin options in the edit check dialog, but doesn't seem to work. Does anyone know the correct options syntax to tell uptime to ignore mismatched cert, self signed certs, etc. on ssl checks?

example of error on a check with ssl cert name not matching host: responded with error "Hostname/IP doesn't match certificate's altnames"

caclifton commented 9 years ago

hack workaround is to add the following line just beneath the top var declarations in the top of ./app.js, (line 18-20 or so) process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; Problem with this workaround is it's global, turns off ssl checks for all checks globally. Still need a way to disable ssl checks/verification for a single host/check

brantje commented 9 years ago

I fixed this, in my fork, i altered the https poller and added the following things:

        this.target.rejectUnauthorized = false;
        this.target.requestCert = true;
        this.target.agent = false;
rjayako commented 9 years ago

Hi @brantje can you point to me where exactly in your fork you added this fix? tried looking at it and could not locate it.

Thank you.

P.S what other changes have you made to your fork? I see a lot of layout changes!

brantje commented 9 years ago

https://github.com/brantje/uptime/blob/master/lib/pollers/https/httpsPoller.js#L54

My fork differs from the other forks: