« UbuntuでWebDAVサーバーその11(自己署名証明書5) | トップページ | UbuntuでWebDAVサーバーその13(自己署名証明書7) »

2012年3月18日 (日)

UbuntuでWebDAVサーバーその12(自己署名証明書6)

前回の続き
大まかに次の手順で、サーバー証明書に署名していく。

1.認証局の証明書を作る。
2.サーバーの秘密鍵、公開鍵を作る。
3.サーバーの証明書署名要求(CSR)を作る。
4.認証局によってCSRに署名して、サーバー証明書とする。
5.サーバー証明書と、サーバーの秘密鍵、公開鍵を、Apacheに設定する。

今回は上の3番の部分。

3.サーバーの証明書署名要求(CSR)を作る。
証明書署名要求(CSR)の作成には、opensslコマンドとコンフィグファイルを使用する。コンフィグファイルは次の場所にある物を元に編集して使う。
 /etc/ssl/openssl.cnf
ホームディレクトリにopenssl.cnfをコピーして来た所で、次の箇所を編集する。

(前略)
[ req_distinguished_name ]
# [ req_distinguished_name ]の中を"commonName"以外、全てコメントアウトする。
#countryName			= Country Name (2 letter code)
#countryName_default		= AU
#countryName_min			= 2
#countryName_max			= 2

#stateOrProvinceName = State or Province Name (full name)
#stateOrProvinceName_default = Some-State

#localityName = Locality Name (eg, city)

#0.organizationName = Organization Name (eg, company)
#0.organizationName_default = Internet Widgits Pty Ltd

# we can do this but it is not needed normally :-)
#1.organizationName = Second Organization Name (eg, company)
#1.organizationName_default = World Wide Web Pty Ltd

#organizationalUnitName = Organizational Unit Name (eg, section)
#organizationalUnitName_default =

commonName = Common Name (eg, YOUR name)
#commonName_max = 64

#emailAddress = Email Address
#emailAddress_max = 64

# SET-ex3 = SET extension number 3
(後略)


上記の変更をしたopenssl.cnfと、また前回作ったサーバー用秘密鍵ファイルwebdav.keyをホームディレクトリに置いて、次のコマンドを実行する。
その後、サーバーのURLなどを聞いてくるので、下のように答える。

$ openssl req -new -config openssl.cnf -key webdav.key -out webdav.csr
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.
-----
Common Name (eg, YOUR name) []:(自分のサイトのURL)

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:リターン
An optional company name []:リターン
$

上記でサーバーの証明書署名要求(CSR)ファイルwebdav.csrが出力される。
次回、このファイルに署名をしてサーバー証明書とする。

« UbuntuでWebDAVサーバーその11(自己署名証明書5) | トップページ | UbuntuでWebDAVサーバーその13(自己署名証明書7) »

「パソコン・インターネット」カテゴリの記事

コメント

コメントを書く

(ウェブ上には掲載しません)

トラックバック


この記事へのトラックバック一覧です: UbuntuでWebDAVサーバーその12(自己署名証明書6):

« UbuntuでWebDAVサーバーその11(自己署名証明書5) | トップページ | UbuntuでWebDAVサーバーその13(自己署名証明書7) »