在node.js中使用request、superagent之类的请求https地址有可能会遇到
unable to verify the first certificate
这个问题是intermediate certificate导致的:the intermediate certificate wasn’t bundled along with the server certificate, you’ll need to fix that
npm上有个package专门可以修复这个问题https://www.npmjs.com/package/ssl-root-cas,网上有很多方法是禁用ssl校验来规避问题,但是这种方法并不安全
其实这个问题很有可能是服务器配置有疏漏导致的,如果是Apache2可以检查一下有没有配置SSLCertificateChainFile