启用有线加密后如何使用 Node.js 连接到 Firebird?

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

我正在尝试使用 Node.js“node-firebird”连接到 Firebird 服务器,但我总是收到错误

Incompatible wire encryption levels requested on client and server at doCallback

问题是我只是想连接一个公司给我数据连接的服务器,但是我无权更改此 Firebird 服务器中的线路加密,他们也不知道如何这样做。

有人可以给我线索,让他们知道该怎么做并让它发挥作用吗?或者,如果您对如何更改我的 JS 上的任何数据以便能够连接有任何建议。

firebird.conf中尝试添加WireCrypt = Enabled

“Firebird 3.0 支持”下的 node-firebird documentation 中记录了如何禁用 Firebird 的 wirecrypt 设置(尽管就个人而言,我建议将 WireCrypt 更改为 Enabled 而不是 Disabled(默认为 Required),因此支持有线协议加密的客户端仍然可以加密其连接。

简而言之:

  1. 打开firebird.conf
  2. 查看WireCrypt是否已经配置,添加或修改为WireCrypt = Enabled#前缀的行是注释)
  3. 重启 Firebird

在应用 node-firebird 文档中建议的其他设置时要小心,因为这可能会导致连接到 Firebird 服务器的其他应用程序出现问题。例如,不要使用建议的 UserManager = Legacy_UserManager,而是使用 UserManager = Srp, Legacy_UserManager.

或者,切换到 Firebird 的另一个 Node.js 库。如果您使用的是 Firebird 3.0 或更高版本的客户端库,则使用 fbclient/libfbclient 的将支持加密。例如,node-firebird-driver-native. Given the documentation of the library is lacking, maybe you'll find this gist 有帮助。