ryanfaerman/node-zencoder — pull request #2 by dmorehouse (2013-04-11 14:39:32+00:00)
Title: Added support for certificate chains

In Node v0.9.2 (now the v0.10.x stable line), the default for validating certificates changed from false to true. With node v0.9.2+, the zencoder npm module fails to send requests to ZenCoder with an "Error: CERT_UNTRUSTED" message.

This failure happens because zencoder_ca_chain.crt is a chain of 3 certificates not a single certificate. Per the documentation http://nodejs.org/api/https.html#https_https_request_options_callback, the ca (certificate authority) property can be a single certificate or an array of multiple certificates. Since there are 3 certificates in this chain, we need to pass them in as an array otherwise the certificate check fails.