googleで検索すると多数Hitするが、メモとして。
# cd /etc/ssl/certs/
# openssl genrsa -des3 -out server.key 1024
Generating RSA private key, 1024 bit long modulus
............++++++
.....++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:(任意のパスフレーズを入力)
Verifying - Enter pass phrase for server.key:(パスフレーズを再入力)
#
Apacheが起動するたびpwを訊いてこないようにするオマジナイ。
# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:(上記で設定したパスフレーズを入力)
writing RSA key
#
秘密鍵の準備の準備が整ったので、今度はサーバー証明書を作成する。
証明書を作成するため、まず証明書要求を作成する。
# openssl req -new -days 3650 -key server.key -out server.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.
-----
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Ibaraki
Locality Name (eg, city) []:Hitachi
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Beach-Linuxer
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:beach.homelinux.org
Email Address []:(空白)
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:(空白)
An optional company name []:(空白)
次に証明書を発行。
# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
Signature ok
subject=/C=JP/ST=Ibaraki/L=Hitachi/O=Beach-Linuxer/OU=/CN=beach.homelinux.org/emailAddress=
Getting Private key
#
念のため、パーミッションを変えておく。
# chmod 400 server.*
#
以上でおわり。
コメント