首页 > 解决方案 > Cubejs:错误:19488:错误:1408F10B:SSL 例程:ssl3_get_record:错误的版本号:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:

问题描述

我正在尝试通过 MongoDB BI Connect 将 Cubejs 连接到 MongoDB。

我的mongosqld命令如下

./mongosqld --config mongosqld.conf -u useradmin -p xxxx --auth --sslMode requireSSL --sslPEMKeyFile mongo.pem 

我通过参考以下链接创建了 mongo.pem 文件

Cube.js:错误:使用 MongoDB BI 连接器使用明文身份验证时需要 ssl

我的 Cube.js .ENV 配置如下

CUBEJS_DEV_MODE=true
CUBEJS_DB_TYPE=mongobi
CUBEJS_API_SECRET= xxxxxx
CUBEJS_EXTERNAL_DEFAULT=true
CUBEJS_SCHEDULED_REFRESH_DEFAULT=true
CUBEJS_WEB_SOCKETS=true
CUBEJS_DB_HOST=localhost
CUBEJS_DB_NAME=RDM
CUBEJS_DB_USER=useradmin
CUBEJS_DB_PASS=xxxx
CUBEJS_DB_SSL=true
CUBEJS_DB_SSL_REJECT_UNAUTHORIZED=false

尝试连接后在 cubejs 中显示错误

Runtime Error
Cube.js was unable to connect to the specified database.
The database returned the following error:
>Database Error
Error: Error: 19488:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:

在 mongosqld 在 powershell 上运行时出现以下错误

2021-10-12T17:15:06.045+0000 I NETWORK    [conn1] connection accepted from 127.0.0.1:61457 #1 (1 connection now open)
2021-10-12T17:15:06.056+0000 E NETWORK    [conn1] handshake error: ERROR 1043 (08S01): recv handshake response error: ERROR 1043 (08S01): ssl configuration error: UseCertificateChainFile: SSL errors: 906d06c:PEM routines:PEM_read_bio:no start line
140dc009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib
2021-10-12T17:15:06.057+0000 I NETWORK    [conn1] end connection 127.0.0.1:61457 (0 connections now open)

从错误中我了解到生成的 .pem 文件不正确。有人可以帮我吗?

标签: mongodbsslopensslcube.jsmongodb-biconnector

解决方案


推荐阅读