You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2021/09/01 15:11:46 UTC

[couchdb-nano] branch main updated: document custom certification authority in README

This is an automated email from the ASF dual-hosted git repository.

glynnbird pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git


The following commit(s) were added to refs/heads/main by this push:
     new da5a5db  document custom certification authority in README
da5a5db is described below

commit da5a5dbce4d05cf87b979c5bc705bc66ef281eb9
Author: Glynn Bird <gl...@apache.org>
AuthorDate: Wed Sep 1 16:11:39 2021 +0100

    document custom certification authority in README
---
 README.md | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/README.md b/README.md
index 60f74ac..887948e 100644
--- a/README.md
+++ b/README.md
@@ -226,6 +226,23 @@ const opts = {
 const db = require('nano')(opts);
 ```
 
+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.
+
+```js
+const httpsAgent = new https.Agent({
+  ca: '/path/to/cert',
+  rejectUnauthorized: true,
+  keepAlive: true,
+  maxSockets: 6
+})
+const nano = Nano({
+  url: process.env.COUCH_URL,
+  requestDefaults: {
+    agent: httpsAgent,
+  }
+})
+```
+
 Please check [axios] for more information on the defaults. They support features like proxies, timeout etc.
 
 You can tell nano to not parse the URL (maybe the server is behind a proxy, is accessed through a rewrite rule or other):