Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Nodejs deepstream连接失败_Node.js_Deepstream.io - Fatal编程技术网

Node.js Nodejs deepstream连接失败

Node.js Nodejs deepstream连接失败,node.js,deepstream.io,Node.js,Deepstream.io,我目前正在学习一些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

我目前正在学习一些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:\Users\xdidemk\Desktop\nodejs\node_modules\deepstream.io-client-js\dist\lib\client.js:204:11)
at Timeout._onTimeout (C:\Users\xdidemk\Desktop\nodejs\node_modules\deepstream.io-client-js\dist\lib\message\connect
 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'

我无法亲自帮助您,但我建议您跳入deepstream Slack聊天并在那里询问。尝试使用ws-protocol而不是wss连接,问题似乎出在您的ssl证书中。请检查配置文件中的ssl配置变量,除非您拥有有效的ssl证书,否则应将其设置为null:
sslKey:null sslCert:null sslCa:null