带有Express的Socket.IO不能使用https(Apache2 Ubuntu16.04)

我不是很有经验的SSL证书,我跳了一个人可以帮助我找出我做错了什么。

我正在尝试使用端口443(从中服务器客户端应用程序而不是NodeJS / Express / Socket.io应用程序)启用了SSL的Apache2来托pipe带有自己端口(*:1729)的NodeJS应用程序。 当我用http设置Express时,它工作正常,我的客户端应用程序没有错误地与NodeJS应用程序通信,但是当我使用https这样的express时:

this.express = require('express'); this.app = this.express(); var https = require('https'); var fs = require('fs'); var sslPath = '/etc/letsencrypt/live/yourdomain.example.com/'; var options = { key: fs.readFileSync(sslPath + 'privkey.pem'), cert: fs.readFileSync(sslPath + 'fullchain.pem') }; this.server = https.createServer(options, this.app); this.io = require('socket.io').listen(this.server); this.server.listen(1729); 

当我的客户端应用程序尝试连接时,我得到这个错误:

在这里输入图像说明

node: ../src/util-inl.h:196: TypeName* node::Unwrap(v8::Local<v8::Object>) [with TypeName = node::TLSWrap]: Assertion ``(object->InternalFieldCount()) > (0)' failed. Aborted (core dumped)

任何意见或更正可能会指向正确的方向将不胜感激,谢谢!

谢谢你的帮助! :)更新我的NodeJS到最新版本,使错误消失,应用程序正在与客户端通信,没有错误。

节点:Github问题#3682

我只是按照这些步骤。

AskUbuntu:我如何更新我的nodeJS到最新版本?