0

I'm trying to connect my script with my database in Firebird, but I have this error.

This is my code, I'm trying to connect to my local database:

const Firebird = require('node-firebird');

var options = {};
options.host = '127.0.0.1';
options.port = 3050;
options.database = 'C:\\DATABASES\\PRUEBA.FDB';
options.user = 'SYSDBA';
options.password = 'password';
options.lowercase_keys = false; // set to true to lowercase keys
options.role = null;            // default
options.pageSize = 4096;  

Firebird.attach(options, (err, db) => {
  if (err) console.log(err);

  db.query('select * from temp', (err, response) => {
    if (err) console.log(err);

    console.log(response);
  })
})

The error is this, but I don't know what happens:

Incompatible wire encryption levels requested on client and server
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Please don't post screenshots, post the error message as code-formatted text. FYI: see [Incompatible wire encryption levels requested on client and server with Firebird ado.net provider](https://stackoverflow.com/questions/37492890/incompatible-wire-encryption-levels-requested-on-client-and-server-with-firebird). Either your connection library doesn't support wire encryption, so the setting `WireCrypt` needs to be relaxed to `Enabled` (from `Required`) on the server, or your server has disabled it and your client requires it (but that is unlikely). – Mark Rotteveel Apr 29 '21 at 16:30
  • The contents of that image are text, and should have been copied and pasted directly into your post instead of providing an image. Images should only be used when there is no other way to demonstrate a problem, which is not the case here. Text in images cannot be searched. Please edit your post to remove the image and include the error message properly. – Ken White Apr 29 '21 at 16:34
  • i work by editing firebird.config file, but now i have this error : ` Error ocurred during login, please check server firebird.log for details ` @MarkRotteveel – Joaquin Hernandez Apr 29 '21 at 16:50
  • So, did you check the firebird.log of your server, and what did it say? Also what is the setting of `AuthServer` in your `firebird.conf`? – Mark Rotteveel Apr 29 '21 at 16:53
  • Yes, I check the firebird.conf and i work, but now have a other problem, ´Conection is cloesd´ @MarkRotteveel – Joaquin Hernandez Apr 29 '21 at 17:02
  • Did you manage to fix the _"Error ocurred during login, please check server firebird.log for details"_ error? – Mark Rotteveel Apr 29 '21 at 17:03
  • Yes, I fixing this problem, but now I have other error, and the error is `Connection is closed` @MarkRotteveel – Joaquin Hernandez Apr 29 '21 at 17:11
  • I recommend you post a new question, and make sure to include the entire stacktrace. – Mark Rotteveel Apr 29 '21 at 17:14

1 Answers1

0

This error "Incompatible wire encryption levels requested on client and server" occurs when you're using Firebird 3 and either the server or the client requires wire encryption, and the other side (usually the client) has wire encryption disabled. In this case, you're using node-firebird, and it doesn't support wire encryption, and always reports it as disabled:

blr.addBytes([CNCT_client_crypt, 4, WIRE_CRYPT_DISABLE, 0, 0, 0]); // WireCrypt = Disabled

On the other hand, the default configuration of Firebird 3 requires wire encryption. In order to connect, you will need to relax this setting from its default of Required to Enabled (or Disabled, but that is less secure for applications that do support wire encryption).

You do this by editing firebird.conf of your server, and modifying or adding:

WireCrypt = Enabled

and then restarting your Firebird server.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197