node-ldapjs
node-ldapjs copied to clipboard
Callback never invoked when starttls fails
When invoking starttls and it fails to etablish a TLS connection, e.g.:
const starttls = (config) => {
const client = ldap.createClient({url: config.url});
return new Promise((resolve, reject) => {
client.starttls({}, [], (tlsErr) => {
if (tlsErr) {
log.error({stack: tlsErr.stack}, tlsErr.message, 'connecting to', config.url, 'failed');
reject(tlsErr);
} else {
log.info('connected to', config.url);
resolve(client);
}
});
});
};
the callback for handling the error is never used. client.starttls({}, [], (tlsErr) returns false, but this can not be used for error handling since it shortcuts the asynchronous operations whether or not the connection is successful or not a failed connection.
Would you be able to submit a PR for this?
👋
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.