Server:
Enterprise Edition 5.1.0 build 5552
Client:
Node 8.9.4 [64bit]
node-gyp 3.6.2
couchnode 2.4.6
libcouchbase 2.8.7 [x64]
Windows 10 [64bit]
Visual Studio 2017
Python 2.7
I understand that the Couchnode SDK doesn’t support SSL and I need to compile one using an external SDK. Thus, a long journey solving the problem. I downloaded all necessary items and installed them (the important ones are listed above). Using the instruction on [Couchbase SDKs](Using an external C SDK) , I tried to do:
npm install couchbase --compile --couchbase-root=PATH.TO.LibCouchBase
But I immediately got a couple missing external error. After some googling, I found that WS2_32.Lib couldn’t be linked. So, I git cloned couchnode and added the location of WS2_32.Lib to binding.gyp. After I did that, I npm install from the local modified couchnode again:
npm install PATH.TO.LOCAL.COUCHNODE.FOLDER --compile --couchbase-root=PATH.TO.LibCouchBase
This time, it installed without failures.
Next, I downloaded the Couchbase server’s certificate to my test Node project’s root (called it couch.pem), and tested with codes like below:
var couchbase = require(‘couchbase’)
var cluster = new couchbase.Cluster(‘couchbases://HOSTNAME?certpath=couch.pem’);
cluster.authenticate(‘USER’, ‘PASS’);
var bucket = cluster.openBucket(‘BUCKET_NAME’);
Unfortunately, it still didn’t work. An error was thrown at:
this._cb = new CBpp(bucketDsn, bucketUser, bucketPass);
CouchbaseError: The requested feature is not supported by the client, either because of settings in the configured instance, or because of options disabled at the time the library was compiled
As far as I can tell, I’ve done everything needed. Do I need to configure anything before building couchnode to turn on SSL?
FYI, I installed Ubunutu on Windows 10’s Linux Subsystem and build with the external C SDK using the command:
npm install couchbase --compile --couchbase-root=/usr/local
The same codes in my Node project above worked. Therefore, I can rule out any problems on my codes, and server setup.