Let's Encrypt
コマンド
以下、example.com
はSSLを発行するドメイン名に変えてください。
# install
yum install epel-release
cd /usr/local/src
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
mv /usr/local/src /usr/local/bin
certbot-auto certonly --manual -d example.com
app.js
const http = require('http');
http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'});
if(req.url == '/.well-known/acme-challenge/***************') {
res.end('***************.***************');
}
}).listen(80, () => console.log('80'));
node app
/etc/letsencrypt/live/example.com
内に証明書が保存されています。