我目前正在关注一些NodeJS和Deepstream.io.client-js教程。但是尝试登录到服务器时发生错误。我不知道这个错误意味着什么,但它就在这里!
const express = require('express'),
bodyParser = require('body-parser'),
ds = require('deepstream.io-client-js'),
app = express();
// Create deepstream client
const client = ds('wss://154.deepstreamhub.com?apiKey=xxx');
client.login();
我得到的错误:
Error: connectionError: Error: self signed certificate in certificate chain (C)
at Client._$onError (C:UsersxdidemkDesktopnodejsnode_modulesdeepstream.io-client-jsdistlibclient.js:204:11)
at Timeout._onTimeout (C:UsersxdidemkDesktopnodejsnode_modulesdeepstream.io-client-jsdistlibmessageconnect
ion.js:315:19)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
你试过添加这个吗?
process.env.NODE_TLS_REJECT_UNAUTHORIZED='0'