ApacheでSSL自己証明書作成(オレオレ証明書)

1.opensslコマンドでSSL自己証明書を作成する

$ mkdir -p /etc/httpd/conf/ssl.key/
$ mkdir -p /etc/httpd/conf/ssl.crt/
$ cd /etc/httpd/conf/ssl.key/
$ 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:パスフレーズ入力
$ openssl req -new -key server.key -sha256 -out 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]:国名
State or Province Name (full name) [Some-State]:都道府県名
Locality Name (eg, city) []:市町村名
Organization Name (eg, company) [Internet Widgits Pty Ltd]:組織名
Organizational Unit Name (eg, section) []:部門名
Common Name (e.g. server FQDN or YOUR name) []:サイト名
Email Address []:メールアドレス(今回は空白)

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:証明書破棄のパスワード(今回は空白)
An optional company name []:別の組織名(今回は空白)

$ cd /etc/httpd/conf/ssl.crt/
$ openssl x509 -in ../ssl.key/server.csr -days 365 -req -signkey ../ssl.key/server.key -sha256 -out server.crt
Signature ok
subject=/C=AU/ST=Ore/L=city/O=Ore Ltd/OU=Ore Section/CN=ore.com
Getting Private key
Enter pass phrase for server.key:パスフレーズ入力

$ ../ssl.key/
$ mv server.key server.key.back
$ openssl rsa -in server.key.back -out server.key
Enter pass phrase for server.key.back:パスフレーズ入力
writing RSA key

$ cat server.key
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA4q/EHXDS5qNlz+drOIMdeJvaE2dQ67gScg1upB32QwF+gv0J
...
HrO1mZrKkIBZTyZOx9asvn3QjzCVqsRyax2xeZLHNv4Uzryjdg7gsg==
-----END RSA PRIVATE KEY-----

$ cat server.crt
-----BEGIN CERTIFICATE-----
MIIDRDCCAiwCCQD6CXRKYd6N5DANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJB
...
uQrOisJooN/glYBQUzeqosaLdCWHP9J4
-----END CERTIFICATE-----

$ cat server.csr
-----BEGIN CERTIFICATE REQUEST-----
MIICqTCCAZECAQAwZDELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA09yZTENMAsGA1UE
...
DQ7sNA6T7M4XRLPVOg==
-----END CERTIFICATE REQUEST-----

$ vi /etc/httpd/conf.d/ssl.conf

# SSLCertificateFile /etc/pki/tls/certs/localhost.crt
# SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
 SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
 SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key


>馬刺しスーパー霜降1kg卸価格【送料無料・あす楽】バレンタイン/バレンタインデー/本命/義理/父/彼氏/上司/酒・ビール・ワイン・焼酎に合う/帰省土産/香典返し/内祝い/贈物/プチギフト/お土産/みやげ/お礼/還暦祝い/特集/霜降り/メガ盛り【RCP】【kss】【k送】sc/ssl

価格:16,200円
(2017/2/18 13:23時点)
感想(36件)


コメント

ドメインサーチ

https://www.makko.biz/whois/?q=bg.bahaiquotesillustrated.info

このブログの人気の投稿

Apacheプロセス増加について

wgetでsitemap作成