localhost에 ssl을 달아보자

소기영·2022년 3월 28일
0

localhost 에 ssl을 달아보자
req.cnf 를 다음과 같이 만들어주고

[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = KO
ST = State
L = Location
O = Organization Name
OU = Organizational Unit
CN = www.localhost.com
[v3_req]
keyUsage = critical, digitalSignature, keyAgreement
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = www.localhost.com
DNS.2 = localhost.com
DNS.3 = localhost

아래 명령어를 입력

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf -sha256

cert 파일 사용가능.

인증서는 내 브라우저에 신뢰할수있는루트 인증서로 등록해줘야 사용 가능.

profile
안녕하세요

0개의 댓글