「忙しい時に限って、サーバーメンテナンス対応はやってくるものだ!」
これって、どこかの諺にありそうだが。。。。
深く理解せずに、google先生に頼りっぱなしのオレは、少しでも次回の手間を省くために、ここに備忘録を残す。
ちゃんとした証明書にしたいが、ちょっとそれも面倒。
という訳で、オレオレ証明書の期限を延長してやり過ごす。
以上
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
root@xxxxxx:/etc/nginx/certs/2016# openssl genrsa -aes128 -out server.key 2048 Generating RSA private key, 2048 bit long modulus .................................................................................+++ .+++ e is 65537 (0x10001) Enter pass phrase for server.key: Verifying - Enter pass phrase for server.key: root@xxxxxx:/etc/nginx/certs/2016# ls server.key root@xxxxxx:/etc/nginx/certs/2016# openssl rsa -in server.key -out server.key Enter pass phrase for server.key: writing RSA key root@xxxxxx:/etc/nginx/certs/2016# 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]:Tokyo Locality Name (eg, city) []:Chiyoda-ku Organization Name (eg, company) [Internet Widgits Pty Ltd]:Ramuda Co.,Ltd Organizational Unit Name (eg, section) []:Network Dept. Common Name (e.g. server FQDN or YOUR name) []:xxx.xxxx.co.jp Email Address []:webmaster@ramuda.co.jp Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: root@xxxxxx:/etc/nginx/certs/2016# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650 Signature ok subject=/C=JP/ST=Tokyo/L=Chiyoda-ku/O=Ramuda Co.,Ltd/OU=Network Dept./CN=xxx.xxxx.co.jp/emailAddress=webmaster@ramuda.co.jp Getting Private key root@xxxxxx:/etc/nginx/certs/2016# chmod 400 server.* root@xxxxxx:/etc/nginx/certs/2016# ls -l total 12 -r-------- 1 root root 1375 Dec 11 13:12 server.crt -r-------- 1 root root 1090 Dec 11 12:51 server.csr -r-------- 1 root root 1675 Dec 11 12:46 server.key root@xxxxxx:/etc/nginx/certs/2016# |