25.8. 自己署名証明書の作成
独自の自己署名証明書を作成できます。自己署名証明書は、CA 署名証明書のセキュリティー保証を提供しない点に注意してください。証明書の詳細は、「証明書の種類」 を参照してください。
独自の自己署名証明書を作成するには、まず「 「キーの生成」 」の手順に従ってランダムな鍵を作成します。キーが完了したら、
/usr/share/ssl/certs/ ディレクトリーにあることを確認し、以下のコマンドを入力します。
make testcert
以下の出力が表示され、パスフレーズの入力が求められます(パスフレーズなしで鍵を生成しない限り)。
umask 77 ; \ /usr/bin/openssl req -new -key -set_serial num /etc/httpd/conf/ssl.key/server.key -x509 -days 365 -out /etc/httpd/conf/ssl.crt/server.crt Using configuration from /usr/share/ssl/openssl.cnf Enter pass phrase:
次に、詳細情報を尋ねられます。コンピューターの出力と入力のセットは以下のようになります(組織およびホストの正しい情報を提供)。
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) [GB]:USState or Province Name (full name) [Berkshire]:North CarolinaLocality Name (eg, city) [Newbury]:RaleighOrganization Name (eg, company) [My Company Ltd]:My Company, Inc.Organizational Unit Name (eg, section) []:DocumentationCommon Name (your name or server's hostname) []:myhost.example.comEmail Address []:myemail@example.com
正しい情報を指定すると、自己署名証明書が
/etc/httpd/conf/ssl.crt/server.crt に作成されます。以下のコマンドを実行して、証明書を生成した後にセキュアなサーバーを再起動します。
/sbin/service httpd restart