FreeBSD/ssl の変更点


*暗号化認証 [#gf8b0ab4]

#contents

**認証キーの作成 [#y6b75aac]
 # openssl genrsa -des 1024 > server.key

**パスフレーズを消去する [#bbe0180f]
 # openssl rsa -in server.key -out server.key
とすると、-in で指定されたファイルを読み込み、-outで指定されたファイルにパスフレーズのない認証キーが生成されます。 

**サイト証明書依頼書の作成 [#xba511eb]
 # openssl req -new -days 365 -key server.key -out server.csr
 
 make csr.pem 
 Country Name (2 letter code) [AU]:JP ←国を入力 
 State or Province Name (full name) [Some-State]:Nagano ←都市を入力 
 Locality Name (eg, city) []:Nagano ←町を入力 
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:ITOH ←会社名などを入力 
 Organizational Unit Name (eg, section) []: ←必要ない 
 Common Name (eg, your name or your server's hostname) []:www.itoh.net ←アドレスを入力 
 Email Address []:webmaster@itoh.co.jp ←メール・アドレスを入力 
 
 Please enter the following 'extra' attributes 
 to be sent with your certificate request 
 A challenge password []: ←必要ない 
 An optional company name []: ←必要ない 

-keyで指定された認証キーを元に -outで指定されたファイルにサイト証明書依頼書が作成されます。 ~
これは、サイト証明書の発行に必要となります。(手続きのしかたはサイト証明書発行局にお問い合わせください) 

**httpd.confの修正 [#ae2dc03b]
 NameVirtualHost 61.192.219.37:443
 
 #### ma21.ath.cx with SSL
 <VirtualHost ma21.ath.cx:443>
 
 DocumentRoot "/home/www/ma21.ath.cx"
 ServerName ma21.ath.cx:443
 ServerAdmin matsui@ma21.ath.cx
 ErrorLog /var/log/httpd/error.log
 SetEnvIf Request_URI "\.(gif)|(jpg)|(png)|(js)|(css)$" no_log
 CustomLog /var/log/httpd/access.log combined env=!no_log
 
 SSLEngine on
 
 SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
 
 SSLCertificateFile /usr/local/etc/apache22/server.crt             # 証明書
 SSLCertificateKeyFile /usr/local/etc/apache22/server.key          # 認証キー
 SSLCertificateChainFile /usr/local/apache2/conf/ssl/dvcacert.cer  # 中間証明書
 
 <FilesMatch "\.(cgi|shtml|phtml|php)$">
     SSLOptions +StdEnvVars
 </FilesMatch>
 <Directory "/usr/local/www/apache22/cgi-bin">
     SSLOptions +StdEnvVars
 </Directory>
 
 BrowserMatch ".*MSIE.*" \
          nokeepalive ssl-unclean-shutdown \
          downgrade-1.0 force-response-1.0
 
 CustomLog /var/log/httpd/httpd-ssl_request.log \
           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
 
 </VirtualHost>

**補足.確認方法など [#vad3a2dd]
1. 秘密鍵の内容を確認
 # openssl rsa -text -noout -in /[FilePath]/[KeyFile]

2. CSRの内容を確認
 # openssl req -text -noout -in /[FilePath]/[CSR]

3. 証明書の内容を確認
 # openssl x509 -text -noout -in /[FilePath]/[CertFile]