您好,抱歉我的英语不好,但是使用NodeJS创建的tchat出现了问题。我的server.js在VPS的端口1337上运行,但是端口不安全,我也不知道他的安全性。
我的所有网站都具有“加密”证书,但是1337端口却不安全... 我尝试使用“让我们加密”来保护https://www.temtem-france.com:1337/,但无法正常工作...:/
我以我的server.js开头:
var https = require('https'),
fs = require('fs'),
mysql = require('mysql');
var options = {
key: fs.readFileSync('/etc/letsencrypt/archive/temtem-france.com/privkey.pem'),
cert: fs.readFileSync('/etc/letsencrypt/archive/temtem-france.com/cert.pem'),
ca: fs.readFileSync('/etc/letsencrypt/archive/temtem-france.com/chain.pem'),
requestCert: false, rejectUnauthorized: false
};
var httpsServer = https.createServer(options, function (req, res) {
res.writeHead(200);
console.log('Affiché');
res.end("Hello World\n");
}).listen(1337);
在我的client.php代码上带有检查器,我有这个:
socket.io.js:1 Failed to load resource: net::ERR_CERT_DATE_INVALID
client.js:31 Uncaught ReferenceError: io is not defined
at client.js:31
at HTMLDocument.<anonymous> (client.js:117)
at i (jquery-min.js:2)
at Object.fireWith [as resolveWith] (jquery-min.js:2)
at Function.ready (jquery-min.js:2)
at HTMLDocument.K (jquery-min.js:2)
Unchecked runtime.lastError: The message port closed before a response was received.
我已经可以运行代码了,但是几个月前,由于我对服务器管理不太满意,所以我忘记了如何成功。
非常感谢您的帮助!