PEM 형식
// curl -k https://localhost:8000/
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
PFX 형식
const https = require('https');
const fs = require('fs');
const options = {
pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
passphrase: 'sample'
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
'http' 카테고리의 다른 글
[무료SSL] 무료SSL추천ZeroSSL (0) | 2021.06.08 |
---|---|
웹사이트 속도 측정 (0) | 2018.01.17 |
ajax jsonp 호출 예제 (0) | 2016.10.19 |