SSLのホスト名変更

ホスト名を変更したので、SSLの証明書を入れなおしました。

/usr/lib/ssl/misc# cp demoCA demoCA_bak
cp: omitting directory `demoCA’
/usr/lib/ssl/misc# ls
CA.pl  c_hash  c_issuer  demoCA       newkey.pem
CA.sh  c_info  c_name    newcert.pem  newreq.pem
/usr/lib/ssl/misc# mv demoCA/ demoCA_bak
/usr/lib/ssl/misc# ls
CA.pl  c_hash  c_issuer  demoCA_bak   newkey.pem
CA.sh  c_info  c_name    newcert.pem  newreq.pem
/usr/lib/ssl/misc# ./CA.sh -newca
CA certificate filename (or enter to create)

Making CA certificate …
Generating a 1024 bit RSA private key
……….++++++
..++++++
writing new private key to ‘./demoCA/private/./cakey.pem’
Enter PEM pass phrase:
Verifying – Enter PEM pass phrase:
—–
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) []:Edogawa
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:tokyo.snuf.org
Email Address []:gen@tokyo.snuf.org

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:gen039
An optional company name []:
Using configuration from /usr/lib/ssl/openssl.cnf
Enter pass phrase for ./demoCA/private/./cakey.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 0 (0x0)
        Validity
            Not Before: Jan 11 12:36:55 2010 GMT
            Not After : Jan 10 12:36:55 2013 GMT
        Subject:
            countryName               = JP
            stateOrProvinceName       = Tokyo
            organizationName          = Internet Widgits Pty Ltd
            commonName                = tokyo.snuf.org
            emailAddress              = xxxxx@tokyo.snuf.org
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                6A:29:3D:AF:58:30:00:C7:F3:36:A4:29:44:02:69:93:C1:11:46:1F
            X509v3 Authority Key Identifier:
                keyid:6A:29:3D:AF:58:30:00:C7:F3:36:A4:29:44:02:69:93:C1:11:46:1F
                DirName:/C=JP/ST=Tokyo/O=Internet Widgits Pty Ltd/CN=tokyo.snuf.org/emailAddress=xxxxx@tokyo.snuf.org
                serial:00

            X509v3 Basic Constraints:
                CA:TRUE
            Netscape Cert Type:
                SSL CA, S/MIME CA
Certificate is to be certified until Jan 10 12:36:55 2013 GMT (1095 days)

Write out database with 1 new entries
Data Base Updated
debian:/usr/lib/ssl/misc#

 

/usr/lib/ssl/misc# openssl rsa -in ./demoCA/private/cakey.pem -out ./demoCA/private/cakey.pem
Enter pass phrase for ./demoCA/private/cakey.pem:
writing RSA key
/usr/lib/ssl/misc# openssl x509 -in ./demoCA/cacert.pem -out ./demoCA/cacert.crt
/usr/lib/ssl/misc# cd demoCA
/debian:/usr/lib/ssl/misc/demoCA# cp cacert.crt /etc/apache2/ssl/cacert.crt
/debian:/usr/lib/ssl/misc/demoCA# cd private/
/usr/lib/ssl/misc/demoCA/private# cp cakey.pem /etc/apache2/ssl/private/cakey.pem
/usr/lib/ssl/misc/demoCA/private# cp cakey.pem /etc/postfix/wwwprkey.pem
/usr/lib/ssl/misc/demoCA# cp cacert.crt /etc/postfix/wwwcrt.pem
/usr/lib/ssl/misc/demoCA#

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA