2009-04-09 CentOS+OpenSSL(自己署名証明書)
CentOS+OpenSSL(自己署名証明書)
Linux設定 |
OpenSSLを使って秘密鍵と証明書を作成しhttps通信を行う。
社内サイトなどの暗号化したいけど認証機関の証明書は必要ないというときに利用。
(いわゆるオレオレ証明書)
1)秘密鍵の作成(openssl genrsa)
2)RSA秘密鍵のパスフレーズ削除(openssl in out)
3)証明書要求(CSR)の作成(openssl req)
4)10年間有効な自己署名証明書の作成(openssl x509)
[root@centos ~]# yum -y install mod_ssl
[root@centos ~]# openssl genrsa -des3 1024 > /etc/pki/tls/private/server.key
Generating RSA private key, 1024 bit long modulus
.................++++++
...................................................++++++
e is 65537 (0x10001)
Enter pass phrase for server.key: パスフレーズ
Verifying - Enter pass phrase for server.key: パスフレーズ
[root@centos ~]# openssl rsa -in /etc/pki/tls/private/server.key -out /etc/pki/tls/private/server.key
Enter pass phrase for server.key: パスフレーズ
[root@centos ~]# chmod 400 /etc/pki/tls/private/server.key
[root@centos ~]# openssl req -new -key /etc/pki/tls/private/server.key -out /etc/pki/tls/certs/server.csr
Enter pass phrase for server.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) [AU]: JP
State or Province Name (full name) [Some-State]: Tokyo
Locality Name (eg, city) []: Chuo-ku
Organization Name (eg, company) [Internet Widgits Pty Ltd]: hogehoge.inc
Organizational Unit Name (eg, section) []: hogehoge
Common Name (eg, YOUR name) []: hogehoge.com
Email Address []: admin@hogehoge.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: <Enter>
An optional company name []: <Enter>
[root@centos ~]# openssl x509 -in /etc/pki/tls/certs/server.csr -out /etc/pki/tls/certs/server.crt -req -signkey /etc/pki/tls/private/server.key -days 3650
Enter pass phrase for server.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) [AU]: JP
State or Province Name (full name) [Some-State]: Tokyo
Locality Name (eg, city) []: Chuo-ku
Organization Name (eg, company) [Internet Widgits Pty Ltd]: hogehoge.inc
Organizational Unit Name (eg, section) []: hogehoge
Common Name (eg, YOUR name) []: hogehoge.com
Email Address []: admin@hogehoge.com
[root@centos ~]# vi /etc/httpd/conf.d/ssl.conf
以下を編集
SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/private/server.key
とあるプログラマー
2009/04/14 17:46
オレオレ詐欺(⌒▽⌒)アハハ
- 6 http://www.google.co.jp/search?q=xen+バックアップ&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_jaJP290JP291
- 5 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=org.mozilla:ja:official&hs=uRl&q=Xen+DomainU&btnG=検索&lr=lang_ja
- 4 http://www.google.co.jp/search?q=centOS+SSL 自己証明&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ja:official&client=firefox-a
- 3 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rlz=1T4GGIH_jaJP271JP271&q=Xen 管理
- 2 http://k.hatena.ne.jp/keywordblog/自己署名証明書
- 2 http://search.yahoo.co.jp/search?p=xen+バックアップ&search.x=1&fr=top_ga1_sa&tid=top_ga1_sa&ei=UTF-8&aq=&oq=
- 2 http://www.google.co.jp/search?hl=ja&q=openSSL+証明書+centos+apache+/etc/pki/tls/&btnG=検索&lr=
- 2 http://www.google.co.jp/search?hl=ja&q=xen+容量 変更&lr=
- 2 http://www.google.co.jp/search?q=xen+容量&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ja-JP-mac:official&client=firefox-a
- 2 http://www.google.co.jp/search?sourceid=navclient&aq=t&hl=ja&ie=UTF-8&rlz=1T4GFRC_jaJP204JP204&q=Xen+イメージファイル ファイルバックア%