From c11717ef4a4e9e1eb60be6915a89efdc7dc04efb Mon Sep 17 00:00:00 2001 From: Niels Roesen Abildgaard Date: Thu, 30 Oct 2014 09:23:11 +0100 Subject: [PATCH] Document how to use custom CA in README (#1229) --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 12864ca21..de477ac44 100644 --- a/README.md +++ b/README.md @@ -466,6 +466,17 @@ request.get({ }); ``` +It is possible to allow a custom certificate authority (CA), by specifying the contents of the certificate-file as `ca`: + +```javascript +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + 'ca': fs.readFileSync("ca.cert.pem") + } +}); +``` + ## request(options, callback) The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.