node-ldapjs icon indicating copy to clipboard operation
node-ldapjs copied to clipboard

Documentation shows false implementation

Open OrbiterToad opened this issue 2 years ago • 1 comments

Hello There i just got started with ldapjs and there doesn't seem to be a fine example of how to use starttls https://github.com/ldapjs/node-ldapjs/blob/master/docs/client.md#starttls

Doc says usage is starttls(options, controls, callback)

But example says

const opts = {
  ca: [fs.readFileSync('mycacert.pem')]
};

client.starttls(opts, (err, res) => {
  assert.ifError(err);

  // Client communication now TLS protected
});

But doesnt seem to be an optional param:

Client.prototype.starttls = function starttls (options, controls, callback, _bypass) {
  //...
}

how do i properly create tls upgrade with the starttls method? or better how do i create/use the control?

OrbiterToad avatar Apr 28 '22 10:04 OrbiterToad

The control is added by the starttls method:

https://github.com/ldapjs/node-ldapjs/blob/9143456b4fa2e07127fb1fd37677fdfd4c73a6c5/lib/client/client.js#L744-L748

jsumners avatar Apr 28 '22 12:04 jsumners

👋

On February 22, 2023, we released version 3 of this library. As a result, we are closing this issue/pull request.

Please see issue #839 for more information, including how to proceed if you feel this closure is in error.

jsumners avatar Feb 22 '23 19:02 jsumners