It could be up to a few things, ive run your code and its fine for me
node --version v0.12.5
so i would look at
- the version of nodejs you are using
root certificates are periodically updated, I suggest updating, because it is possible that the certificate used is newer than the root certificates in your distribution, and therefore shows as unreliable
network - itβs possible that you are behind a proxy server that is doing something unexpected with your requests.
target server, it may return something unexpected.
Most likely, 1, that you are using a version of nodejs that does not recognize the site certificate provider and therefore says that it is unreliable.
I would put 2 and 3 at about the same level of probability. if you are spidering wikipedia, they may have blocked you / clicked on the error page where the certificate may be invalid.
While you, like other posters, could turn off verification, I would advise against it as a habit. And never do this in a production environment.
The only time I break this rule is self-signed certificates on local machines.
source share