Fedora 11
Sponsored Link

SSL証明書を作成する2009/06/14

  SSLを用いた信頼性の高い通信経路を構築するために必要な証明書を作成します。
ここでは証明書は独自のものを作成します。が、独自作成のものは当然ブラウザ等にデフォルトでインストールされていないため、 アクセス時に警告が出ます。インストールしてしまえば問題はありません。 よって、内部のみで使用する分には独自のものでかまわないでしょうが、企業等で外向けに使う場合は ベリサイン 等の正規の認証局が発行する証明書を利用した方がよいでしょう。
[root@www ~]#
cd /etc/pki/tls/certs

[root@www certs]#
make server.key

umask 77 ; \
/usr/bin/openssl genrsa -des3 1024 > server.key

Generating RSA private key, 1024 bit long modulus
......................................................++++++
.............++++++
e is 65537 (0x10001)
Enter pass phrase:
# パスフレーズ入力

Verifying - Enter pass phrase:
# 再入力


# 秘密鍵からパスフレーズを削除

[root@www certs]#
openssl rsa -in server.key -out server.key

Enter pass phrase for server.key:
# パスフレーズ入力

writing RSA key
[root@www certs]#
[root@www certs]#
make server.csr

umask 77 ; \
/usr/bin/openssl req -utf8 -new -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) [GB]:
JP
 
# 国

State or Province Name (full name) [Berkshire]:
Hiroshima
 
# 地域(県)

Locality Name (eg, city) [Newbury]:
Hiroshima
 
# 都市

Organization Name (eg, company) [My Company Ltd]:
Server Linux
 
# 組織名

Organizational Unit Name (eg, section) []:
IT Solution
 
# 組織の部門名

Common Name (eg, your server's hostname) []:
www1.srv.world
 
# サーバーのFQDN

Email Address []:
root@srv.world
 
# メールアドレス

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
# 空Enter

An optional company name []:
# 空Enter

[root@www certs]#
[root@www certs]#
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
  # 有効期限が10年の証明書を作成

Signature ok
subject=/C=JP/ST=Hiroshima/L=Hiroshima/O=Server World/OU=IT Solution/CN=www1.srv.world/emailAddress=root@srv.world
Getting Private key
[root@www certs]#
chmod 400 server.*
関連コンテンツ