실습 TLS: 인증서 검사, PFS 검증, 로컬 HTTPS 서버 구축

발행: (2025년 12월 23일 오후 01:00 GMT+9)
2 min read
원문: Dev.to

Source: Dev.to

Hands‑On TLS: 인증서 검사, PFS 검증 및 로컬 HTTPS 서버 구축을 위한 커버 이미지

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.pemcert.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
Back to Blog

관련 글

더 보기 »

SSL/TLS 인증서 이해

이름 게임: SSL vs TLS SSL(Secure Sockets Layer)과 TLS(Transport Layer Security)는 종종 같은 의미로 사용되지만, SSL은 사실상 사라졌습니다. 더 이상…