我正在使用ioRedis node包将我的node js应用程序连接到通过TLS保护的redis服务器。我正在使用的Redis版本是Redis 6.0。我的服务器使用证书运行正常,但是在从node应用程序连接时出现错误。
Redis({
host: "localhost",
port: 6379,
tls: {
key: fs.readFileSync('./redis.key'),
cert: fs.readFileSync('./redis.crt'),
maxVersion: 'TLSv1.3',
minVersion: 'TLSv1.3',
ca: [fs.readFileSync('./redis.pem')]
}
})
Node.js 应用程序出现错误的原因是
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
尝试从nodejs应用连接时,服务器出现错误。
17:29:44.295 # 错误接受客户端连接:error:1408F10B:SSL routines:ssl3_get_record:wrong version number
目标是仅使用TLS安全性建立redis连接。