acme.js/examples/https-server.js

16 lines
364 B
JavaScript
Raw Normal View History

2019-10-26 06:03:43 +00:00
'use strict';
var https = require('http2');
var fs = require('fs');
var key = fs.readFileSync('./privkey.pem');
var cert = fs.readFileSync('./fullchain.pem');
var server = https
2020-07-28 21:53:50 +00:00
.createSecureServer({ key, cert }, function (req, res) {
2019-10-26 06:03:43 +00:00
res.end('Hello, Encrypted World!');
})
2020-07-28 21:53:50 +00:00
.listen(443, function () {
2019-10-26 06:03:43 +00:00
console.info('Listening on', server.address());
});