C:\WINNT>cd \ C:\>cd \apache\bin C:\apache\bin>apache -k install |
C:\WINNT>cd \apache\conf C:\apache\conf>md certs C:\apache\conf>cd certs |
C:\apache\conf\certs>..\..\bin\openssl genrsa -des3 1024 > webtribe.key.pem Loading 'screen' into random state - done Generating RSA private key, 1024 bit long modulus .......................................................++++++ ....................++++++ e is 65537 (0x10001) Enter pass phrase: <== パスフレーズを入力します。 Verifying - Enter pass phrase: <== もう一度パスフレーズを入力します。 |
C:\apache\conf\certs>..\..\bin\openssl rsa -in webtribe.key.pem -out webtribe.key.pem Enter pass phrase for webtribe.key.pem: <== 先ほど入力したパスフレーズを入力します writing RSA key |
[ req ] default_bits = 1024 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes x509_extensions = v3_ca string_mask = nombstr [ req_distinguished_name ] countryName = Country Name (2 letter code) countryName_default = JP countryName_min = 2 countryName_max = 2 stateOrProvinceName = State or Province Name (full name) stateOrProvinceName_default = Osaka localityName = Locality Name (eg, city) 0.organizationName = Organization Name (eg, company) 0.organizationName_default = Media Knowledge Industrial Co.,Ltd. organizationalUnitName = Organizational Unit Name (eg, section) commonName = Common Name (eg, YOUR name) commonName_max = 64 emailAddress = Email Address emailAddress_max = 64 [ req_attributes ] challengePassword = A challenge password challengePassword_min = 4 challengePassword_max = 20 unstructuredName = An optional company name [ v3_req ] basicConstraints = CA:FALSE keyUsage = nonRepudiation, digitalSignature, keyEncipherment [ v3_ca ] subjectKeyIdentifier=hash authorityKeyIdentifier=keyid:always,issuer:always |
C:\apache\conf\certs>set OPENSSL_CONF=openssl.cnf C:\apache\conf\certs>..\..\bin\openssl req -new -key webtribe.key.pem -out webtribe.csr.pem 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) [JP]:JP State or Province Name (full name) [Osaka]:Osaka Locality Name (eg, city) []:Osaka Organization Name (eg, company) [Media Knowledge Industrial Co.,Ltd.]:Media Knowledge Industrial Co.,Ltd. Organizational Unit Name (eg, section) []:Product Common Name (eg, YOUR name) []:webtribe.mki.ne.jp Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: |
C:\apache\conf\certs>..\..\bin\openssl x509 -in webtribe.csr.pem -out webtribe.cert.pem -req -signkey webtribe.key.pem -days 365 Loading 'screen' into random state - done Signature ok subject=/C=JP/ST=Osaka/L=Osaka/O=Media Knowledge Industrial Co.,Ltd./OU=Product/CN=webtribe.mki.ne.jp Getting Private key |
# コメントを解除 (変更前) #LoadModule ssl_module modules/mod_ssl.so (変更後) LoadModule ssl_module modules/mod_ssl.so # サーバ管理者のメールアドレスを指定 (変更前) ServerAdmin @@ServerAdmin@@ (変更後) ServerAdmin webmaster@mki.ne.jp # サーバ名を指定(CSR の Common Name と同じ名前) (変更前) ServerName localhost:80 (変更後) ServerName webtribe.mki.ne.jp # 省略時の charset(HTTP ヘッダに設定)を指定 (変更前) AddDefaultCharset ISO-8859-1 (変更後) AddDefaultCharset Off |
LoadModule jk2_module modules/mod_jk2-2.0.43.dll |
# コメントを解除 (変更前) #SSLSessionCache none (変更後) SSLSessionCache none # コメントアウト (変更前) SSLSessionCache dbm:@exp_runtimedir@/ssl_scache (変更後) #SSLSessionCache dbm:@exp_runtimedir@/ssl_scache # コメントアウト (変更前) SSLSessionCacheTimeout 300 (変更後) #SSLSessionCacheTimeout 300 # コメントアウト (変更前) SSLMutex file:@exp_runtimedir@/ssl_mutex (変更後) #SSLMutex file:@exp_runtimedir@/ssl_mutex # ドキュメントルートを指定 (変更前) DocumentRoot "@exp_htdocsdir@" (変更後) DocumentRoot "htdocs" # サーバ名を指定(CSR の Common Name と同じ名前) (変更前) ServerName www.example.com:443 (変更後) ServerName webtribe.mki.ne.jp # サーバ管理者のメールアドレス (変更前) ServerAdmin you@example.com (変更後) ServerAdmin webmaster@mki.ne.jp # エラーログファイルのパス (変更前) ErrorLog @exp_logfiledir@/error_log (変更後) ErrorLog logs/error_log # アクセスログファイルのパス (変更前) TransferLog @exp_logfiledir@/access_log (変更後) TransferLog logs/access_log # 証明書ファイルのパス (変更前) SSLCertificateFile @exp_sysconfdir@/ssl.crt/server.crt (変更後) SSLCertificateFile conf/certs/webtribe.cert.pem # 秘密鍵ファイルのパス (変更前) SSLCertificateKeyFile @exp_sysconfdir@/ssl.key/server.key (変更後) SSLCertificateKeyFile conf/certs/webtribe.key.pem # カスタムログファイルのパス (変更前) CustomLog @exp_logfiledir@/ssl_request_log \ (変更後) CustomLog logs/ssl_request_log \ |
(変更前) <IfDefine SSL> (変更後) #<IfDefine SSL> |
(変更前) </IfDefine> (変更後) #</IfDefine> |
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> |
[logger.file:0] level=ERROR file=${serverRoot}/logs/jk2.log [shm:] disabled=1 [channel.socket:localhost:8009] [status:] [uri:/jkstatus/*] group=status: [uri:/webtribe/*] |
※ | 補足 J2SDK 1.3.1_09 ではサーバ証明書の正当性を確認することができなかった場合、エラーになり、サーバに HTTPS で接続することができませんでしたが、J2SDK 1.4.2_02 の動作を確認したところ、警告ダイアログが表示され、ユーザの責任のもとにサーバに HTTPS で接続することができるようになっています。 |
C:\WINNT>cd \Program Files\Java\j2re1.4.2_02\lib\security C:\Program Files\Java\j2re1.4.2_02\lib\security>keytool -import -trustcacerts -keystore cacerts -alias webtribe -storetype jks -file c:\certs\webtribe.cert.pem キーストアのパスワードを入力してください: changeit <== cacerts の初期パスワードは changeit です 所有者: CN=webtribe.mki.ne.jp, OU=Product, O="Media Knowledge Industrial Co.,Ltd.", L=Osaka, ST=Osaka, C=JP 実行者: CN=webtribe.mki.ne.jp, OU=Product, O="Media Knowledge Industrial Co.,Ltd.", L=Osaka, ST=Osaka, C=JP シリアル番号: 0 有効日: Fri Dec 05 15:19:15 JST 2003 有効期限: Sat Dec 04 15:19:15 JST 2004 証明書のフィンガープリント: MD5: 35:F5:E2:D7:2F:75:0B:4A:00:B5:ED:1B:48:16:07:B2 SHA1: 7A:9C:41:93:BD:29:D6:E0:6C:49:80:57:D2:F5:A7:6D:67:60:11:10 この証明書を信頼しますか? [no]: yes 証明書がキーストアに追加されました。 |
パラメータ |
説明 |
---|---|
-import |
インポート |
-trustcacerts |
インポートするのは、信頼できる認証局の発行した証明書 (自己署名のサーバ証明書を信頼する、ということになります。) |
-keystore |
信頼されたルート証明書を格納するファイル |
-alias |
インポートする証明書の別名 |
-storetype |
証明書ストアのタイプ |
-file |
証明書ファイル |