ssl 인증서 갱신

리눅스 2015. 4. 20. 10:28

 1. key 값 생성

openssl genrsa -des3 -out DOMAINNAME.key 2048


확인

openssl rsa -noout -text -in DOMAINNAME.key



 2. csr 생성

openssl req -new -key DOMAINNAME.key -out DOMAINNAME.csr


Country Name (2 letter code) [GB]:KR                                 #나라를 나타내는 2문자의 ISO약어

State or Province Name (full name) [Berkshire]:Seoul               #조직이 있는 시도

Locality Name (eg, city) [Newbury]:Seocho-gu                       #조직이 있는 구동

Organization Name (eg, company) [My Company Ltd]:DMI       #조직의 법률상의 정식명칭

Organizational Unit Name (eg, section) []:                                #조직의 부서명

Common Name (eg, your name or your server's hostname) []:  #발급받을 정확한 FQDN의 도메인

Email Address []:                                                                  #이메일 주소


Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:                                                #엔터로 다음로 넘어간다, 생략 가능

An optional company name []:                                         #엔터로 다음로 넘어간다, 생략 가능


csr 확인

openssl req -noout -text -in DOMAINNAME.csr

   

-이제 생성된 key와 csr을 인증업체에 보내면 인증서 설치를 위한 crt를 발급해준다.


 3. 설치 

ssl.conf에 인증서 위치에 발급받은 값을 넣어주자/


100 #   Server Certificate:

101 # Point SSLCertificateFile at a PEM encoded certificate.  If

102 # the certificate is encrypted, then you will be prompted for a

103 # pass phrase.  Note that a kill -HUP will prompt again.  A new

104 # certificate can be generated using the genkey(1) command.

105 SSLCertificateFile /etc/httpd/ssl/jh.felix123.kr.crt

106 

107 #   Server Private Key:

108 #   If the key is not combined with the certificate, use this

109 #   directive to point at the key file.  Keep in mind that if

110 #   you've both a RSA and a DSA private key you can configure

111 #   both in parallel (to also allow the use of DSA ciphers, etc.)

112 SSLCertificateKeyFile /etc/httpd/ssl/jh.felix123.kr.key


-----------------------------------------------------------------------------------------------------------------------------------------------------------------


인증서 패스워드 제거

 openssl rsa -in jh.felix123.kr.key -out jh.felix123.kr.key

 writing RSA key


요런 메시지가 뜨고 용량을 확인하면 줄어들어있는걸 알 수 있다.




crt 생성

-인증업체가 발급해주니 필요는 없지만...

openssl req -x509 -days 365 -key -DOMAINNAME.key -in -DOMAINNAME.csr > -DOMAINNAME.crt



키값 확인 명령어


openssl x509 -noout -modulus -in ssl.crt | openssl md5


openssl rsa -noout -modulus -in ssl.key | openssl md5


openssl req -noout -modulus -in ssl.csr | openssl md5


각 값의 md5가 일치해야 동일 인증서



인증서 확인 

openssl x509 -in /app/apache/conf/server.crt -noout -text


'리눅스' 카테고리의 다른 글

캐릭터셋 변경하기  (0) 2015.04.20
파일시스템 오류 give root password for maintenance  (0) 2015.04.20
freetds 설치  (0) 2015.04.15
HDD 파티션, 마운트, 포멧  (0) 2015.04.15
configure 옵션 확인  (0) 2015.04.15
Posted by Narusika
,