错误:客户端和服务器请求的线路加密级别不兼容 - 尝试使用 Firebird 4.0 连接节点服务器

问题描述 投票:0回答:1

我正在尝试建立连接,但遇到错误。尽管进行了深入的研究并探索了各种解决方案,但没有一个对我有效,包括在

firebird.conf
文件中的启用和禁用之间切换 WireCrypt 设置。我也用 Firebird 5.0 对此进行了测试,但问题仍然存在。是的,我重新启动了服务器和我的电脑。

请注意:使用 Firebird 3.0 或更早版本对我来说不是一个选择。

我的代码:

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;
});
node.js firebird node-firebird firebird-4.0
1个回答
0
投票

问题是node-firebird会报告错误“客户端和服务器上请求的线路加密级别不兼容”当客户端尝试的身份验证插件与服务器期望的身份验证插件之间不匹配时,而不仅仅是当它可以时'无法建立连接,因为服务器将

WireCrypt
设置为
Required
(默认值)。

node-firebird 驱动程序实现了

Srp
身份验证,但尽管 Firebird 4.0 和 5.0 仍然支持它,但它们默认只接受
Srp256
身份验证,node-firebird 不会尝试这种身份验证,因此连接失败被拒绝。然后,node-firebird 驱动程序错误地认为这是由于加密级别造成的,并报告错误的错误。

要解决此问题,您需要对您的

firebird.conf
:

进行两项更改
  1. 设置
    WireCrypt = Enabled
    (不要使用
    Disabled
    ,因为这也会禁用支持它的驱动程序的加密)
  2. 设置
    AuthClient = Srp256, Srp
    Srp
    不如
    Srp256
    安全,所以应该在after
    Srp256
    之后尝试)

进行这些更改后,重新启动 Firebird 服务器,您的 Node.js 应用程序现在应该能够连接。

© www.soinside.com 2019 - 2024. All rights reserved.