Fedora 21
Sponsored Link

SSL証明書を作成する2014/12/30

  サーバー独自の SSL 自己署名証明書を作成します。 ただし、独自に作成した証明書ではアクセス時に警告が出るため、 商用で利用する場合はベリサイン等の正規の認証局が発行する証明書を利用した方がよいでしょう。
[root@www ~]#
cd /etc/pki/tls/certs

[root@www certs]#
make server.key

umask 77 ; \
/usr/bin/openssl genrsa -aes128 2048 > server.key
Generating RSA private key, 2048 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]#
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) [XX]:
JP
   
# 国

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

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

Organization Name (eg, company) [Default Company Ltd]:
GTS
   
# 組織名

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

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

Email Address []:
xxx@srv.world
   
# 管理者アドレス

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

An optional company name []:    
# Enter
# 有効期限が10年の自己署名証明書を作成

[root@www certs]#
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650

Signature ok
subject=/C=JP/ST=Hiroshima/L=Hiroshima/O=GTS/OU=Server World/CN=www.srv.world/emailAddress=xxx@srv.world
Getting Private key
関連コンテンツ