Description
Hi,
today I went through a tough debugging session due to meaningless error messages.
The scenario:
I was only able to connect to a new domain controller via LDAPS from my local machine (running OsX).
My debian server however isn't able to connect and throws the following error message:
admin: {
"code": "UNSPECIFIED"
}
Pretty expressive! :D
After checking credentials, environment vars, certificates, several server logs, network configuration / firewall traffic, etc.
I copied the complete sourcecode of this project and added logging messages till I finally got the cause:
EE certificate key too weak
My colleague who set up the domain controller used a certificate with a keylength of 1024 bit - which is obviously bad.
I guess OsX is handling this less strict than debian. (Well, it could also be caused by the env-var NODE_ENV=production on the debian machine. I don't know that detail for sure.)
(I look forward that it will work as soon as my colleague replaces the certificate.)
Nevertheless I'd prefer if the error messages thrown inside the client.on-callbacks in the _ldapBind function would be passed along somehow.
client.on('timeout', (err) => {
reject(err);
});
client.on('connectTimeout', (err) => {
reject(err);
});
client.on('error', (err) => {
// Could print the meaningful error message here
reject(err);
});
client.on('connectError', function (error) {
if (error) {
// And here
reject(error);
return;
}
});
Thanks and have a nice day! :)