I'm attempting to establish a connection, but I'm encountering an error. Despite thorough research and exploring various solutions, none have been effective for me, including toggling the WireCrypt setting between enabled and disabled in the firebird.conf file. I've also tested this with Firebird 5.0, but the issue persists. Yes, I restarted both the server and my PC.
Please note: using Firebird 3.0 or earlier versions is not an option for me.
My code:
const firebird = require('node-firebird');
const options = {
host: 'localhost',
port: 3050,
database: 'C:\\Vetor\\INTEGRACAO\\BANCO\\5175_REALIZA_JURANDIR.FDB',
user: 'SYSDBA',
password: 'SySkatrog',
lowercase_keys: false,
role: null,
pageSize: 4096,
retryConnectionInterval: 1000, // reconnect interval in case of connection drop
blobAsText: false, // set to true to get blob as text, only affects blob subtype 1
encoding: 'UTF-8'
};
firebird.attach(options, function(err, db) {
if (err) throw err;
});
The problem is that node-firebird reports the error "Incompatible wire encryption levels requested on client and server" also when there is a mismatch between authentication plugins tried by the client and expected by the server, and not just when it can't establish a connection because the server has
WireCryptset toRequired(the default).The node-firebird driver implements the
Srpauthentication, but though Firebird 4.0 and 5.0 still support it, they default to only acceptingSrp256authentication, which the node-firebird doesn't attempt, and as a result, the connection is rejected. The node-firebird driver then incorrectly assumes this was due to the encryption level and reports the wrong error.To fix this, you need to make two changes to your
firebird.conf:WireCrypt = Enabled(don't useDisabled, as that will also disable encryption for drivers that do support it)AuthClient = Srp256, Srp(Srpis less secure thanSrp256, so it should be tried afterSrp256)After making these changes, restart the Firebird server, and your Node.js application should now be able to connect.