E D R S I H C RSS
ID
Password
Join
일하는 것이 즐거울 때 인생은 얼마나 기쁜가! 일하는 것이 의무일 때 인생은 얼마나 노예와 같은가! -막심 고리끼

 * 원문참조링크 : [http]http://network.hanbitbook.co.kr/view_news.htm?serial=688 [http]http://network.hanbitbook.co.kr/view_news.htm?serial=689
  • 일단 위 링크 내용을 퍼다놓은 상태입니다. 실험을 통해서 단계와 캡쳐화면등등을 넣어놓을 생각입니다.

Contents

1 인증기관 만들기
2 웹서버용 공개 인증서 생성 및 설치
3 그럼 브라우저에서는?

1 인증기관 만들기 #

맨 첫줄을 참조해서 실행한다음 각각의 입력이 들어올때마다 알맞게 입력한다.
hagbard@fnord:~/certs$  /usr/local/ssl/misc/CA.pl -newca
CA certificate filename (or enter to create)

Making CA certificate ...
Using configuration from /usr/local/ssl/openssl.cnf
Generating a 1024 bit RSA private key
...............++++++
......................................++++++
writing new private key to './demoCA/private/cakey.pem'
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:
-----
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) [AU]:US
State or Province Name (full name) [Some-State]:California
Locality Name (eg, city) []:Sebastopol
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Illuminatus
   Enterprises, Ltd
Organizational Unit Name (eg, section) []:Administration
Common Name (eg, YOUR name) []:Hagbard Celine
Email Address []:hagbardceline1723@yahoo.com
아래와 같이 생성된 인증기관의 내용을 확인한다.
hagbard@fnord:~/certs$  ls
demoCA/
hagbard@fnord:~/certs$ cd demoCA/
hagbard@fnord:~/certs/demoCA$ ls -l
total 24
-rw-r--r--    1 rob      users        1407 Sep  8 14:12 cacert.pem
drwxr-xr-x    2 rob      users        4096 Sep  8 14:12 certs/
drwxr-xr-x    2 rob      users        4096 Sep  8 14:12 crl/
-rw-r--r--    1 rob      users           0 Sep  8 14:12 index.txt
drwxr-xr-x    2 rob      users        4096 Sep  8 14:12 newcerts/
drwxr-xr-x    2 rob      users        4096 Sep  8 14:12 private/
-rw-r--r--    1 rob      users           3 Sep  8 14:12 serial
새 인증서 발행 기관의 공개키는 cacert.pem에, 개인키는 private/cakey.pem에 담겨있다. 이제 이 개인키를 사용해서 여타 SSL 인증서에 서명할 수 있다.

2 웹서버용 공개 인증서 생성 및 설치 #

아래와 같이 실행한다.
hagbard@fnord:~/certs$ openssl ca -policy policy_anything -out propaganda.discordia.eris.crt -infiles propaganda.discordia.eris.csr
Using configuration from /usr/local/ssl/openssl.cnf
Enter PEM pass phrase:
Check that the request matches the signature
Signature ok
The Subjects Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'Texas'
localityName          :PRINTABLE:'Mad Dog'
organizationName      :PRINTABLE:'Discordia, Inc.'
organizationalUnitName:PRINTABLE:'Operations'
commonName            :PRINTABLE:'propaganda.discordia.eris'
emailAddress          :IA5STRING:'hail@discordia.eris'
Certificate is to be certified until Sep  8 22:49:26 2003 GMT (365 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
혹시나 익스플로러를 위해서 pem화일이 아닌 der포맷으로 인증서를 변환하려면 다음과 같이 한다.
openssl x509 -in demoCA/cacert.pem -outform DER -out cacert.der
이제 아파치+mod_ssl에서 httpd.conf에 다음과 같이 적는다.
SSLCertificateFile /usr/local/apache/conf/ssl.crt/propaganda.discordia.eris.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/propaganda.discordia.eris.key
그다음에는 conf/mime.types화일에 다음을 추가한다.
application/x-x509-ca-cert      der pem crt
이제 웹서버를 재시작하면 된다.

3 그럼 브라우저에서는? #

이제 웹페이지에 접속하면 해당 인증서에 적어놓은 기관명에 대해서 신뢰하는지 물어보게 된다. 이를 OK하면 이후에는 이 인증서를 사용하여 암호화를 하게되고, 해당 처리들을 모두 신뢰한 상태로 간주하게 된다.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-10-28 12:42:52
Processing time 0.3511 sec