rootca_openssl.conf 파일 생성 및 내용
------------------------------------------------------------------------------------
[ req ]
default_bits = 2048
default_md = sha1
default_keyfile = lesstif-rootca.key
distinguished_name = req_distinguished_name
extensions = v3_ca
req_extensions = v3_ca
[ v3_ca ]
basicConstraints = critical, CA:TRUE, pathlen:0
subjectKeyIdentifier = hash
##authorityKeyIdentifier = keyid:always, issuer:always
keyUsage = keyCertSign, cRLSign
nsCertType = sslCA, emailCA, objCA
[req_distinguished_name ]
countryName = KR
countryName_default = KR
countryName_min = 2
countryName_max = 2
# 회사명 입력
organizationName = Jssolution Co Ltd
organizationName_default = Jssolution Co Ltd
# 부서 입력
#organizationalUnitName = Organizational Unit Name (eg, section)
#organizationalUnitName_default = Condor Project
# SSL 서비스할 domain 명 입력
commonName = Jssolution's Self Signed CA
commonName_default = Jssolution's Self Signed CA
commonName_max = 64
---------------------------------rootCa----------------------------------------------------
openssl req -new -key lesstif-rootca.key -out lesstif-rootca.csr -config rootca_openssl.conf
openssl x509 -req -days 3650 -extensions v3_ca -set_serial 1 -in lesstif-rootca.csr -signkey lesstif-rootca.key -out lesstif-rootca.crt -extfile rootca_openssl.conf
openssl x509 -text -in lesstif-rootca.crt
-----------------------------------------------
openssl genrsa -aes256 -out lesstif.com.key 2048
개인키 pass phrase 제거
cp lesstif.com.key lesstif.com.key.enc
openssl rsa -in lesstif.com.key.enc -out lesstif.com.key
CSR(Certificate Signing Request) 생성을 위한 host_openssl.conf 로 저장
host_openssl.conf 생성 및 내용
[ req ]
default_bits = 2048
default_md = sha1
default_keyfile = lesstif-rootca.key
distinguished_name = req_distinguished_name
extensions = v3_user
## 인증서 요청시에도 extension 이 들어가면 authorityKeyIdentifier 를 찾지 못해 에러가 나므로 막아둔다.
## req_extensions = v3_user
[ v3_user ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
authorityKeyIdentifier = keyid,issuer
subjectKeyIdentifier = hash
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
## SSL 용 확장키 필드
extendedKeyUsage = serverAuth,clientAuth
subjectAltName = @alt_names
[ alt_names]
## Subject AltName의 DNSName field에 SSL Host 의 도메인 이름을 적어준다.
## 멀티 도메인일 경우 *.lesstif.com 처럼 쓸 수 있다.
DNS.1 = www.lesstif.com
DNS.2 = lesstif.com
DNS.3 = *.lesstif.com
[req_distinguished_name ]
countryName = KR
countryName_default = KR
countryName_min = 2
countryName_max = 2
# 회사명 입력
organizationName = Jssolution Co Ltd
organizationName_default = Jssolution Co Ltd
# 부서 입력
organizationalUnitName = Support
organizationalUnitName_default = Support
# SSL 서비스할 domain 명 입력
commonName = webs.co.kr
commonName_default = webs.co.kr
commonName_max = 64
SSL 인증서 요청
openssl req -new -key lesstif.com.key -out lesstif.com.csr -config host_openssl.conf
5년짜리 lesstif.com 용 SSL 인증서 발급 (서명시 ROOT CA 개인키로 서명)
openssl x509 -req -days 1825 -extensions v3_user -in lesstif.com.csr -CA lesstif-rootca.crt -CAcreateserial -CAkey lesstif-rootca.key -out lesstif.com.crt -extfile host_openssl.conf
확인
openssl x509 -text -in lesstif.com.crt