실습 TLS: 인증서 검사, PFS 검증, 로컬 HTTPS 서버 구축
발행: (2025년 12월 23일 오후 01:00 GMT+9)
2 min read
원문: Dev.to
Source: Dev.to

TL;DR
세 가지 간단한 검사를 실행합니다:
- 브라우저 인증서
openssl s_client- DevTools 혼합 콘텐츠 스캔
Node.js 예제를 사용해 로컬에서 실험해 보세요.
확인할 항목:
- TLS 1.2 / TLS 1.3
- AEAD 암호화 방식
- 완전 전방 비밀성(PFS)을 위한 ECDHE
Minimal HTTPS Server (Node.js)
server.js 파일로 저장합니다. key.pem과 cert.pem이 필요합니다(로컬 테스트용이라면 자체 서명 인증서면 충분합니다).
// server.js
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('secure chat placeholder\n');
}).listen(8443, () => {
console.log('Listening on https://localhost:8443');
});
Create a Local Certificate (Testing Only)
openssl req -x509 -newkey rsa:2048 -nodes \
-keyout key.pem \
-out cert.pem \
-days 365 \
-subj "/C=IN/ST=State/L=City/O=Org/CN=localhost"
Hit It
node server.js
curl -vkI https://localhost:8443 --insecure
Inspect a Production Certificate (OpenSSL)
openssl s_client -connect example.com:443 -servername example.com