Skip to content

Commit da5a5db

Browse files
author
Glynn Bird
committed
document custom certification authority in README
1 parent 26303fa commit da5a5db

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,23 @@ const opts = {
226226
const db = require('nano')(opts);
227227
```
228228

229+
Nano works perfectly well over HTTPS as long as the SSL cert is signed by a certification authority known by your client operating system. If you have a custom or self-signed certificate, you may need to create your own HTTPS agent and pass it to Nano e.g.
230+
231+
```js
232+
const httpsAgent = new https.Agent({
233+
ca: '/path/to/cert',
234+
rejectUnauthorized: true,
235+
keepAlive: true,
236+
maxSockets: 6
237+
})
238+
const nano = Nano({
239+
url: process.env.COUCH_URL,
240+
requestDefaults: {
241+
agent: httpsAgent,
242+
}
243+
})
244+
```
245+
229246
Please check [axios] for more information on the defaults. They support features like proxies, timeout etc.
230247

231248
You can tell nano to not parse the URL (maybe the server is behind a proxy, is accessed through a rewrite rule or other):

0 commit comments

Comments
 (0)