Search code examples
node.jsfirebirdnode-firebird

How to connect to Firebird with Node.js when wire encryption is enabled?


I'm trying to connect to a Firebird server with Node.js "node-firebird", but I always get the error

Incompatible wire encryption levels requested on client and server at doCallback

The problem is that I'm just trying to connect on a server that a company gave me the data to connect, however I don't have access to change the wire crypt in this Firebird server, neither they know how to do that.

Could someone give me the leads to show them what to do and make it works? Or if you have any suggestions on how to change on my JS any data to be able to connect.


Solution

  • How to disable the wirecrypt setting of Firebird is documented in the node-firebird documentation under "Firebird 3.0 Support" (though personally, I would recommend changing WireCrypt to Enabled instead of Disabled (the default is Required), so clients that do support wire protocol encryption can still encrypt their connection.

    In short:

    1. Open firebird.conf
    2. See if WireCrypt is already configured, and add or modify it to WireCrypt = Enabled (lines prefixed with # are comments)
    3. Restart Firebird

    Be careful with applying the other settings as suggested in the node-firebird documentation, as that might cause problems for other applications connecting to the Firebird server. For example, instead of the suggested UserManager = Legacy_UserManager, use UserManager = Srp, Legacy_UserManager.

    Alternatively, switch to another Node.js library for Firebird. The ones using fbclient/libfbclient will support encryption if you're using a Firebird 3.0 or higher client library. For example, node-firebird-driver-native. Given the documentation of the library is lacking, maybe you'll find this gist helpful.

    In case you're using Firebird 4.0 or higher, also look at Error: Incompatible wire encryption levels requested on client and server - trying to connect node server with Firebird 4.0.