root@wl ~ # wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz root@wl ~ # tar xvfz openssl-0.9.8k.tar.gz root@wl ~ # cd openssl-0.9.8k root@wl ~/openssl-0.9.8k # ./config shared 메시지 생략 Configured for solaris-x86-cc. root@wl ~/openssl-0.9.8k # make 메시지 생략 making all in tools... root@wl ~/openssl-0.9.8k # make test 1) 메시지 생략 compiler: cc -KPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fast -O -Xa OPENSSLDIR: "/usr/local/ssl" `test' is up to date. root@wl ~/openssl-0.9.8k # make install 메시지 생략 chmod 644 /usr/local/ssl/lib/pkgconfig/openssl.pc root@wl ~/openssl-0.9.8k # # 환경 설정 root@wl ~ # vi /etc/profile # for OpenSSL located at /usr/local/ssl if [ -d /usr/local/ssl ] then PATH=$PATH:/usr/local/ssl/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ssl/lib fi1) OpenSSL은 반드시 테스트를 하자. 흔하지는 않지만 gcc, cc의 버그로 인해 테스트에 실패하는 경우가 있다. 이런경우 패치를 하거나, gcc, cc, openssl 버전을 낮추거나 gcc, cc의 옵티마이징을 꺼야 한다. [compiler: cc ...] 부분은 시스템마다 다를 수 있다.
# 솔라리스 10에 0.9.7d 이 설치되어있다. 경로만 걸어준다. root@wl ~ # cd /usr/local/bin root@wl /usr/local/bin # ln -s /usr/sfw/bin/openssl openssl
root@wl ~ # wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz root@wl ~ # gunzip libgcc-3.4.6-sol10-x86-local.gz root@wl ~ # pkgadd -d libgcc-3.4.6-sol10-x86-local root@wl ~ # wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/openssl-0.9.8h-sol10-x86-local.gz root@wl ~ # gunzip openssl-0.9.8h-sol10-x86-local.gz root@wl ~ # pkgadd -d openssl-0.9.8h-sol10-x86-local
root@wl ~ # cd /usr/local/ssl/certs root@wl /usr/local/ssl/certs # openssl req -newkey rsa:2048 -nodes -out req.pem -keyout req.key 1) Generating a 2048 bit RSA private key .......++++++ .......++++++ writing new private key to '/usr/local/ssl/certs/root.cert' ----- 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]:KR State or Province Name (full name) [Some-State]:GyungGiDo Locality Name (eg, city) []:Suwon Organization Name (eg, company) [Internet Widgits Pty Ltd]:Solanara Organizational Unit Name (eg, section) []:SolanaraTeam Common Name (eg, YOUR name) []:*.solanara.net 2) Email Address []:admin@solanara.net Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: root@wl /usr/local/ssl/certs # ls -alF 3)1) OpenSSL 버전이 낮으면 [-newkey rsa:2048]에서 오류가 난다. [-new]로 대체한다.
root@wl /usr/local/ssl/certs # openssl genrsa -des3 -out ca.key 2048 1) Generating RSA private key, 2048 bit long modulus ............................++++++ ............++++++ e is 65537 (0x10001) Enter pass phrase for ca.key:***** Verifying - Enter pass phrase for ca.key: ***** root@wl /usr/local/ssl/certs # openssl req -new -x509 -days 365 -key ca.key -out ca.crt 2) Enter pass phrase for ca.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) [AU]:KR State or Province Name (full name) [Some-State]:GyungGiDo Locality Name (eg, city) []:Suwon Organization Name (eg, company) [Internet Widgits Pty Ltd]:Solanara Organizational Unit Name (eg, section) []:SolanaraTeam Common Name (eg, YOUR name) []:Solanara CA Email Address []:admin@solanara.net root@wl /usr/local/ssl/certs # openssl x509 -req -CA ca.crt -CAkey ca.key -days 365 -in req.pem -out signed-req.pem -CAcreateserial 3) Signature ok subject=/C=KR/ST=GyungGiDo/L=Suwon/O=Solanara/OU=SolanaraTeam/CN=wl.solanara.net/emailAddress=admin@solanara.net Getting CA Private Key Enter pass phrase for ca.key:***** root@wl /usr/local/ssl/certs # chmod 600 * root@wl /usr/local/ssl/certs # ls -alF 4) 총 18 drwxr-xr-x 2 root bin 512 10월 26일 13:44 ./ drwxr-xr-x 10 root bin 512 10월 26일 13:40 ../ -rw------- 1 root other 1671 4월 8일 11:27 ca.crt -rw------- 1 root other 1751 4월 8일 11:26 ca.key -rw------- 1 root other 17 4월 8일 11:49 ca.srl -rw------- 1 root other 1679 4월 8일 11:48 req.key -rw------- 1 root other 1074 4월 8일 11:48 req.pem -rw------- 1 root other 1330 4월 8일 11:49 signed-req.pem root@wl /usr/local/ssl/certs #1) Root CA의 2048bit private key 파일을 만든다. 결과 파일은 ca.key 이다.
root@wl /usr/local/ssl/certs # openssl req -newkey rsa:4096 -nodes -out req.pem -keyout req.key \ -subj "/C=KR/ST=GyungGiDo/L=Suwon/O=Solanara/OU=SolanaraTeam/CN=*.solanara.net/emailAddress=admin@solanara.net" root@wl /usr/local/ssl/certs # openssl genrsa -des3 -out ca.key 4096 Enter pass phrase for ca.key:12345 Verifying - Enter pass phrase for ca.key:12345 root@wl /usr/local/ssl/certs # openssl req -new -x509 -days 3650 -key ca.key -out ca.crt \ -subj "/C=KR/ST=GyungGiDo/L=Suwon/O=Solanara/OU=SolanaraTeam/CN=Solanara CA/emailAddress=admin@solanara.net" Enter pass phrase for ca.key:12345 root@wl /usr/local/ssl/certs # openssl x509 -req -CA ca.crt -CAkey ca.key -days 3650 -in req.pem -out signed-req.pem -CAcreateserial Enter pass phrase for ca.key:12345 root@wl /usr/local/ssl/certs #
|
|
Copyright © 2004-2010 Jo HoSeok. All rights reserved. |