danwrong/restler — pull request #163 by rashthedude (2014-03-06 15:45:07+00:00)
Title: Adding the ability to add a custom https agent.

We have a requirement such that we need to make non standard HTTPS calls. We need to alter the https agent and pass information on where to read the cert, ca and cert files are not provided by the connection.

An example use case is as follows
options = {
hostname: parsed.hostname,
port: parsed.port,
path: parsed.path,
method: 'POST',
key: fs.readFileSync('/var/www/apps/custom/current/config/certs/custom.key'),
cert: fs.readFileSync('/var/www/apps/custom/current/config/certs/custom.crt')
ca: fs.readFileSync('/var/www/apps/custom/current/config/certs/customca.crt')
}
agent = new https.Agent(options)

restler.post(@mtUrl, {data: params, agent: agent}).on 'success', function(data, resp) {
// bla bla
})

The pull request is super simple so would be excellent if you could merge it in.