事前確認事項 †作成する †パスフレーズ付き †openssl md5 * > rand.dat openssl genrsa -rand rand.dat -des3 (キー長) > (秘密鍵ファイル名) 例 openssl genrsa -rand rand.dat -des3 2048 > 2010key.pem > パスフレーズ入力(忘れずに) openssl req -new -key (秘密鍵ファイル名) -out (CSRファイル名) 例: openssl req -new -key 2010key.pem -out 2010csr.pem 秘密鍵のパスフレーズの入力する 一般的な事を入れる 以下は入れなくてもよい Email Address []: A challenge password []: An optional company name []: パスフレーズなし †openssl md5 * > rand.dat openssl genrsa -rand rand.dat -des3 (キー長) > (秘密鍵ファイル名) 例: openssl genrsa -rand rand.dat -out server.key 2048 openssl req -new -key server.key -out (CSRファイル名) 一般的な事を入れる 以下は入れなくてもよい Email Address []: A challenge password []: An optional company name []: 自前局でのSSL生成 †上記でcsr/keyを生成する openssl x509 -req -in server.csr -signkey server.key -out server.crt -days 日時 LBでのSSL †LB serverA | |--Web Server B |--Web Server C こんな場合SSLは、基本3台入れないと行けない。。。が! マルチドメイン証明書 †マルチドメイン証明書とは 提供サービス †確認方法 †・秘密鍵内と証明書内にある "modulus" 部分が完全に一致しないとだめ! 外部から確認 その1 †telnet サイトドメインなど 443 Trying XXX.XXX.XXX.XXX... Connected to example.jp. Escape character is '^]'. HEAD ./index.html HEAD/1.0[e]<-入力 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> Reason: You're speaking plain HTTP to an SSL-enabled server port.<br /> Instead use the HTTPS scheme to access this URL, please.<br /> <blockquote>Hint: <a href="https://example.jp/"><b>https://example.jp /</b></a> </blockquote></p> <hr> <address>Apache/2.2.9 (Debian) PHP/5.2.13-0.dotdeb.0 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8o Server at example.jp Port 443</address> </body></html> Connection closed by foreign host. OpenSSLのversionを知ることが出来る 外部から確認その2 †openssl s_client -connect www.example.jp:443 内部で確認 †openssl version -a OpenSSL 0.9.8o 01 Jun 2010 built on: Sun Jun 6 19:06:05 UTC 2010 platform: debian-i386-i686/cmov options: bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O3 -march=i686 -Wa,--noexecstack -g -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM OPENSSLDIR: "/usr/lib/ssl" 秘密鍵内容を確認 †openssl rsa -in /etc/ssl/private/key.pem -text 証明書の確認 †openssl x509 -in /etc/ssl/certs/key.pem -text CSRの確認 †openssl req -in key.csr -text 中間証明書を確認する †openssl x509 -text -noout -in ca.crt CRLの内容確認 †openssl crl -in key.crl -text ※証明書とCRLを比較する事で証明書が最新の物であることが分かる Apache2で設定されている共通鍵暗号方式を確認する †openssl ciphers -v ‘ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW’ 設定箇所 †エラー時には †参考URL † |