Error: Incompatible wire encryption levels requested on client and server - trying to connect node server with Firebird 4.0

42 Views Asked by At

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;
});
2

There are 2 best solutions below

0
Mark Rotteveel On

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 WireCrypt set to Required (the default).

The node-firebird driver implements the Srp authentication, but though Firebird 4.0 and 5.0 still support it, they default to only accepting Srp256 authentication, 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:

  1. Set WireCrypt = Enabled (don't use Disabled, as that will also disable encryption for drivers that do support it)
  2. Set AuthClient = Srp256, Srp (Srp is less secure than Srp256, so it should be tried after Srp256)

After making these changes, restart the Firebird server, and your Node.js application should now be able to connect.

0
Arthur Prezotto Andrade On

I had to do two things, First was to remove the separation of client and server and put them both in just one variable. Second, I followed Mark Rotteveel's suggestion, but I didn't set AuthClient = Srp256, Srp as he said, I had to set AuthClient = Legacy_Auth, Srp, Win_Sspi.

Anyway, he helped me.