自己署名証明書の作成

独自の自己署名証明書を作成することができます。自己署名証明書の場合は、CA の署名付き証明書の提供するセキュリティ上の保証が提供されないことに注意してください。証明書の詳細については、the section called 証明書のタイプ を参照してください。

自己署名証明書を作成したい場合は、まず the section called 鍵の生成 で説明する指示にしたがってランダム鍵を作成する必要があります。鍵を作成したら、以下のコマンドを使用します。

make testcert

そうすると、以下の出力が表示され、パスワードを入力するように求められます (パスワードなしで鍵を生成した場合を除く)。

umask 77 ; \
/usr/bin/openssl req -new -key /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 PEM 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) [AU]:US State or Province Name (full name) [Some-State]:North Carolina Locality Name (eg, city) []:Durham Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Company, Inc.Organizational Unit Name (eg, section) []:Documentation Common Name (eg, your name or your server's hostname) []:myhost.mydomain.com Email Address []:myemail@mydomain.com 

正確な情報を入力すると、自己署名証明書が作成され、/etc/httpd/conf/ssl.crt/server.crf の中に保存されます。証明書が生成された後で、セキュアサーバを再スタートする必要があります。安全な Web サーバの停止と起動の方法については、the section called Apache の起動と停止 を参照してください。