X509 Client Certificate Authentication with NodeJS


#1

Hello,

What are the connection options if I want to try the Couchbase 5.5 client x509 certificate authentication feature in the NodeJS SDK? i.e. we use a combination of path,prefix,delimiter to specify the username in the certificate.

For Ex in Java, I have to specify certAuthEnabled(true) in the environment build options.

Thanks,
Satish


#2

Hey Satish,

You can connect to a Couchbase cluster with x509 certificate authentication by calling cluster.authenticate with a CertAuthenticator and additionally passing the certificate information in your connection string according to the C SDK’s semantics. You can find that information here:
https://developer.couchbase.com/documentation/server/5.1/sdk/nodejs/sdk-authentication-overview.html#story-h2-6

Cheers, Brett


#3

Hi Brett,

So just the below ?

var cluster = new couchbase.Cluster('couchbases://172.31.38.161?certpath=/Users/sanupin/SSLCA/mre/int.pem');
var certAuth = new CertAuthenticator();
cluster.authenticate(certAuth);
var bucket = cluster.openBucket('bucket_name');

Or do you have another example?

Thanks,
Satish