自己証明書(オレオレ認証) †証明書作成 †opensslの理解はこのページでは省略 apacheや、メールなどでも証明書を必要とすることが多いので、オレオレ証明書の登場が多い。 用意するものはデフォルトで使えるものなので、特に難しいものはない。 # rpm -qa |grep openssl 作り方 †
# cd /etc/pki/tls/certs/ # ls # mkdir old # cp -p Makefile old/Makefile.org # sed -i 's/365/3650/g' Makefile # make server.crt 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: #←パスフレーズを再入力 umask 77 ; \ /usr/bin/openssl req -new -key server.key -x509 -days 3650 -out server.crt -set_serial 0 Enter pass phrase for server.key: #←keyファイルのパスフレーズ入力 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) []:Tokyo #←都道府県名応答 Locality Name (eg, city) [Default City]:Chiyoda-Ku #←市区町村名応答 Organization Name (eg, company) [Default Company Ltd]:oreore.com #←会社名応答 Organizational Unit Name (eg, section) []: #←部署名応答 Common Name (eg, your name or your server's hostname) []:hogehoge.com #←サイト名 Email Address []: #←管理者メールアドレス # ls キーに付いているパスフレーズが邪魔なので解除する。 # openssl rsa -in server.key -out server.key 以上で完了。 あとはapacheなりpostfixなりなんにでも使えるオレオレ証明。 |