ЕП

Вот песочница: https://codepen.io/DTX/pen/eYpMmVe
Size: a a a
ЕП
АК
const https = require('https');
…
const app = express();
…
const port_ssl = 443;
const port_http = 80;
https.createServer({
key: fs.readFileSync(root+'/ssl/cert.key'),
cert: fs.readFileSync(root+'/ssl/cert.pem')
}, app).listen(port_ssl,function(){
console.log('HTTPS on ' + port_ssl);
});
app.listen(port_http,function(){
console.log('HTTP on ' + port_http);
});
🦜
АК
const https = require('https');
…
const app = express();
…
const port_ssl = 443;
const port_http = 80;
https.createServer({
key: fs.readFileSync(root+'/ssl/cert.key'),
cert: fs.readFileSync(root+'/ssl/cert.pem')
}, app).listen(port_ssl,function(){
console.log('HTTPS on ' + port_ssl);
});
app.listen(port_http,function(){
console.log('HTTP on ' + port_http);
});
openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf.txt -sha256
req.cnf.txt
:[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = VA
L = SomeCity
O = MyCompany
OU = MyDivision
CN = localhost
[v3_req]
keyUsage = critical, digitalSignature, keyAgreement
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
Ш
А
CM
Ш
L
L
L
Ш
L
С
L
V🦖