Add support for CA certificates

As noted in [this StackOverflow question](http://stackoverflow.com/questions/13448065/generating-an-ssl-key-to-work-with-node-js) there are some SSL certificates that require an additional certificate chain. This PR adds that support

cc @jrowny @ingorichter