"리눅스 자체서명 SSL 인증서 생성"의 두 판 사이의 차이

27번째 줄: 27번째 줄:
==서버 인증요청서 생성==
==서버 인증요청서 생성==
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
....................................................................................................................................................................................+++
..........................................................+++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
[root@jmnote ~]# openssl req -new -key server.key -out server.csr
[root@jmnote ~]# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key:
Enter pass phrase for server.key:
50번째 줄: 43번째 줄:
Locality Name (eg, city) [Default City]:Yeongdeungpo
Locality Name (eg, city) [Default City]:Yeongdeungpo
Organization Name (eg, company) [Default Company Ltd]:Jmnote
Organization Name (eg, company) [Default Company Ltd]:Jmnote
Organizational Unit Name (eg, section) []:jmnote
Organizational Unit Name (eg, section) []:Jmnote
Common Name (eg, your name or your server's hostname) []:jmnote.com
Common Name (eg, your name or your server's hostname) []:jmnote.com
Email Address []:web@jmnote.com
Email Address []:web@jmnote.com

2012년 9월 23일 (일) 19:10 판

How to create a self-signed SSL Certificate
리눅스 개인서명 SSL 인증서 생성
리눅스 OpenSSL 인증서 설치

1 개요

여기서는 개인 인증기관을 만들고 인증서를 발급받아 보자. 웹브라우저에서는 신뢰할 수 없는 사이트라고 나오지만, 어쨌든 사용자(웹 접속자)만 동의하면 SSL 기능을 이용할 수 있다.

2 확인

리눅스를 설치했다면 아마도 openssl 패키지가 설치되어 있을 것이다.[1]

[root@jmnote ~]# rpm -qa openssl
openssl-1.0.0-20.el6_2.5.x86_64

3 개인키 생성

[root@jmnote ~]# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
....................................................................................................................................................................................+++
..........................................................+++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
→ 서버 개인키인 server.key 파일이 생성된다.

4 서버 인증요청서 생성

[root@jmnote ~]# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key:
→ 서버 개인키 패스워드 입력
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:KR
State or Province Name (full name) []:Seoul
Locality Name (eg, city) [Default City]:Yeongdeungpo
Organization Name (eg, company) [Default Company Ltd]:Jmnote
Organizational Unit Name (eg, section) []:Jmnote
Common Name (eg, your name or your server's hostname) []:jmnote.com
Email Address []:web@jmnote.com
→ 자신의 경우에 맞게 적절히 입력
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
→ 그냥 Enter, Enter
→ 서버 인증요청서인 server.csr 파일이 생성되었다.

5 서버 인증서 생성

[root@jmnote ~]# openssl x509 -req -days 3560 -in server.csr -signkey server.key -out server.crt -CA my_ca.crt -CAkey my_ca.key -CAcreateserial
Signature ok
subject=/C=KR/ST=Seoul/L=Yeongdeungpo/O=Jmnote/OU=jmnote/CN=jmnote.com/emailAddress=web@jmnote.com
Getting Private key
Enter pass phrase for server.key:
→ 서버 개인키 패스워드 입력
Getting CA Private Key
Enter pass phrase for my_ca.key:
→ CA 개인키 패스워드 입력
→ 서버 인증서인 server.csr이 생성되었다.

6 같이 보기

7 주석

  1. 리눅스는 SSH 접속을 기본 제공하는데, 거기에도 openssl이 필요하다. CentOS 6 최소 설치 패키지 목록에도 포함되어 있다.

8 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}