无法即使安装SSL证书后,确保在Firefox网站
我使用下面的代码在我的网站上安装SSL证书:
const express = require('express');
const path = require('path');
const app = express();
const fs= require('fs');
let privateKey = fs.readFileSync('certificate/x.key', 'utf8');
let ca = fs.readFileSync('certificate/x.crt', 'utf8');
let certificate = fs.readFileSync('certificate/x.crt', 'utf8');
let credentials = { key: privateKey, cert: certificate, ca: ca };
const http = require('http');
const https = require('https');
app.use(express.static(path.join(__dirname, 'build')));
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
let httpsServer = https.createServer(credentials, app);
httpsServer.listen(443);
这是一个反应程序,我通过Node.js的服务它
当我打开浏览器或微软边缘的网站,它显示了连接,安全,加密和有效的,但是当我打开它在Firefox,则说明该连接不牢固。
可能是什么问题呢?
回答如下:如果您的中间证书包含多个块,那么你应该将它们分割成不同的文件,并在这样的CA参数数组给他们一个接一个:
let credentials = { key: privateKey, cert: certificate, ca: [
fs.readFileSync('certificate/x_1.pem', 'utf8'),
fs.readFileSync('certificate/x_2.pem', 'utf8'),
fs.readFileSync('certificate/x_3.pem', 'utf8'),
[...]
] };
无法即使安装SSL证书后,确保在Firefox网站
我使用下面的代码在我的网站上安装SSL证书:
const express = require('express');
const path = require('path');
const app = express();
const fs= require('fs');
let privateKey = fs.readFileSync('certificate/x.key', 'utf8');
let ca = fs.readFileSync('certificate/x.crt', 'utf8');
let certificate = fs.readFileSync('certificate/x.crt', 'utf8');
let credentials = { key: privateKey, cert: certificate, ca: ca };
const http = require('http');
const https = require('https');
app.use(express.static(path.join(__dirname, 'build')));
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
let httpsServer = https.createServer(credentials, app);
httpsServer.listen(443);
这是一个反应程序,我通过Node.js的服务它
当我打开浏览器或微软边缘的网站,它显示了连接,安全,加密和有效的,但是当我打开它在Firefox,则说明该连接不牢固。
可能是什么问题呢?
回答如下:如果您的中间证书包含多个块,那么你应该将它们分割成不同的文件,并在这样的CA参数数组给他们一个接一个:
let credentials = { key: privateKey, cert: certificate, ca: [
fs.readFileSync('certificate/x_1.pem', 'utf8'),
fs.readFileSync('certificate/x_2.pem', 'utf8'),
fs.readFileSync('certificate/x_3.pem', 'utf8'),
[...]
] };