Bug fixed: some variables which name should be tls_client where renamed to conn.
Improvement on tls: If you want to use rejectUnauthorized: true parameter for an ssl/tls connection you can now supply a CA certs array to be considered as trusted.

e.g.
var options = {
  keyPath: KEY,
  certPath: CERT,
  rejectUnauthorized : true,
  ca: ['./crt.ca.cg.pem'] //list of cert paths
};
Bug fixed: some variables which name should be tls_client where renamed to conn.
Improvement on tls: If you want to use rejectUnauthorized: true parameter for an ssl/tls connection you can now supply a CA certs array to be considered as trusted.

e.g.
var options = {
  keyPath: KEY,
  certPath: CERT,
  rejectUnauthorized : true,
  ca: ['./crt.ca.cg.pem'] //list of cert paths
};
No error is thrown if ca parameter is not used on a ssl connection
Added test and examples
Fixed bug in test
Merge pull request #129 from anjz/master

Pass a CA list of trusted certificates to a TLS connection, just in case you want to use the rejectUnauthorized: true