node.js - Nodejs https does not fail on ssl certificate failure -
i using https library nodejs send https request using following code. valid 200 status though certificate of server being tested expired.
https.get(options, this.onresponsecallback.bind(this));
the value of options shown below.
{ protocol: 'https: ', slashes: true, auth: null, host: 'xxxxxxxx', port: '443', hostname: 'xxxxxxxx', hash: null, search: 'xxxxxxxx', query: 'xxxxxxxx', pathname: '/xxxxxxxx/xxxxxxxx', path: '/xxxxxxxx/xxxxxxxx?xxxxxxxx', href: 'https://xxxxxxxx', headers: { 'user-agent': 'nodeuptime/3.0(https://github.com/fzaninotto/uptime)' }, rejectunauthorized: true }
if hit same url in browser following error.
how nodejs fail when cert expired?
i think browser security policy bit stricter can in node.
you can access info server's certificate by:
https.request(options, function(response){ var cert = response.client.pair.cleartext.getpeercertificate(); });
.valid_to
looking for.
more info tls.
Comments
Post a Comment