Win Node SDK built using external SDK still couldn't do SSL

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.

node.js SDK for windows uses bundled libcouchbase and supports SSL.

If you wan’t to recompile couchnode with external libcouchbase, you have to first compile libcouchbase with OpenSSL support. You can run cbc.exe version to quickly check if your libcouchbase binary supports SSL.

1 Like

OMG! Couchbase really should make it clear in their documentation. Now you mentioned that, I can understand what the following line IMPLIES on their Start Using SDK page:

On the Windows platform using Node.js versions prior to 6.0, manual installation of OpenSSL and the C SDK (libcouchbase) is required. It is recommended to use Node.js 6.0 and later.

But that is very confusing after I read further down in the page under Using an external C SDK, they explicitly state that an external C SDK is needed in order to use SSL with Couchbase.

Thanks avsej for saving my day, and thanks Couchbase for wasting me 2 days!