Problem connecting with the rainbow-node-sdk
Hello,
i'm trying to connect to Rainbow using the NodeJS rainbow-node-sdk, this is my code:
const RainbowSDK = require('rainbow-node-sdk')
const start = async () => {
const rainbowSDK = new RainbowSDK({
rainbow: { host: 'official' },
credentials: {
login: 'email',
password: '*******'
},
application: {
appID: 'applicationid',
appSecret: '**************'
},
logs: {
enableConsoleLogs: true,
level: 'debug'
},
im: { sendReadReceipt: true },
})
rainbowSDK.start().then(() => {
console.log('started')
})
}
start()
.catch((e) => {console.log(e)})
After the script execution i receive this logs:
11/6/2024 1:24:52 PM [1730895892737] - warn:HTTP - (MyRequestHandler::request) The req method call ERROR. req.url : https://openrainbow.com:443/api/rainbow/authentication/v1.0/login , Iter 1 / 1 , responseRequest : {
code: -1,
url: 'https://openrainbow.com:443/api/rainbow/authentication/v1.0/login',
msg: 'ErrorManager while requesting',
details: Error: self-signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1677:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1076:8)
at ssl.onhandshakedone (node:_tls_wrap:862:12) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'
},
headers: undefined
}
SDK version: 2.25.2-lts.11
Node version: v20.18.0
The credentials and the application i'm using are correct, in fact, i successfully logged in using the REST API..
How can i proceed? Thank you in advance
Fausto
-
The issue is linked to certificates.
You can have look on https://stackoverflow.com/questions/45088006/nodejs-error-self-signed-certificate-in-certificate-chain to see the possible options to solve it.
If you are on a "dev system", the more simple is to use :
export NODE_TLS_REJECT_UNAUTHORIZED='0' node app.js
Iniciar sesión para dejar un comentario.
Comentarios
2 comentarios