Locked History Actions

Diff for "ssl-cert"

Differences between revisions 1 and 7 (spanning 6 versions)
Revision 1 as of 2018-11-12 06:16:03
Size: 979
Comment:
Revision 7 as of 2018-11-13 04:43:24
Size: 3356
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from ssl-selfcert
Line 14: Line 15:
= SSL自己発行証明書(暫定)の作成方法 = = SSL証明書の作成方法 =

==
= SSL自己発行証明書(暫定)の作成 ===
Line 26: Line 29:


=== Let's Encrypt SSL証明書の作成 ===

参考
[[https://letsencrypt.jp/|Let's Encrypt 総合]]、
[[https://letsencrypt.jp/usage/|Let's Encryptの使い方]]、
[[https://letsencrypt.jp/docs/using.html|Let's Encrypt ユーザーガイド]]

SL7/CentOS7の場合

1.certbotを epelからインストール
{{{
# yum install epel-release
# yum install certbot python-certbot-apache
}}}

2. httpdを停止して、初期の証明書ファイルを作成 (注:あらかじめ、SSL自己発行証明書でセキュリティ監査を受け、http/https は外部にopenしていること)

{{{
# systemctl stop httpd
# certbot certonly --standalone -d ribfnewhost.riken.jp
}}}
その後、自分のEmailアドレスを入力、規約を読み承諾(A)gree する。後半の選択(share your email address with the Electronic Frontier
Foundation)は、必要があれば承諾する(無理に承諾する必要はない)その後、以下のようにSSL証明書が作成される。

{{{
Starting new HTTPS connection (1): supporters.eff.org
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for ribfnewhost.riken.jp
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/ribfnewhost.riken.jp/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/ribfnewhost.riken.jp/privkey.pem
   Your cert will expire on 2019-02-05. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
   Donating to EFF: https://eff.org/donate-le
}}}

3.証明書の有効期限は3ヶ月なので、cronで自動更新の設定(月に2回〜週に1度程度実行)

crontabで月に2回〜週に1度程度の頻度で
{{{
certbot renew
}}}
を実行(certbot実行時は http/https は外部に対して openしている必要がある)

SSL証明書の作成方法

SSL自己発行証明書(暫定)の作成

1. opensslを使用してSHA1で署名する場合(期限10年)

openssl genrsa -out test.key 2048
openssl req -new -key test.key -x509 -days 3652 -out test.crt -sha1

内容の確認方法

openssl x509 -text -noout -in test.crt

Let's Encrypt SSL証明書の作成

参考 Let's Encrypt 総合Let's Encryptの使い方Let's Encrypt ユーザーガイド

SL7/CentOS7の場合

1.certbotを epelからインストール

# yum install epel-release
# yum install certbot python-certbot-apache

2. httpdを停止して、初期の証明書ファイルを作成 (注:あらかじめ、SSL自己発行証明書でセキュリティ監査を受け、http/https は外部にopenしていること)

# systemctl stop httpd
# certbot certonly --standalone -d ribfnewhost.riken.jp

その後、自分のEmailアドレスを入力、規約を読み承諾(A)gree する。後半の選択(share your email address with the Electronic Frontier Foundation)は、必要があれば承諾する(無理に承諾する必要はない)その後、以下のようにSSL証明書が作成される。

Starting new HTTPS connection (1): supporters.eff.org
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for ribfnewhost.riken.jp
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/ribfnewhost.riken.jp/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/ribfnewhost.riken.jp/privkey.pem
   Your cert will expire on 2019-02-05. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

3.証明書の有効期限は3ヶ月なので、cronで自動更新の設定(月に2回〜週に1度程度実行)

crontabで月に2回〜週に1度程度の頻度で

certbot renew

を実行(certbot実行時は http/https は外部に対して openしている必要がある)