このページはサーバ証明書を新規に発行してもらう手順について説明しています。
# openssl req -new -x509 -newkey rsa:2048 -out host_req.pem -keyout host_key.pem Using configuration from /usr/local/ssl/openssl.cnf Generating a 2048 bit RSA private key .....................+++++ ......................................................................+++++ writing new private key to 'host_key.pem' Enter PEM pass phrase: Verifying password - 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) [JP]:JP Locality Name (eg, city) []: Organization Name (eg, company) [WIDE Project]:WIDE Project Organizational Unit Name (eg, section) []:NAIST Common Name (eg, YOUR name) []:moca.aist-nara.ac.jp Email Address []:taiji-k@is.aist-nara.ac.jp Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:例二 Apache の Makefile を利用する場合:(太字が入力する事項、下線つきは必須項目です)
# cd Apache/src # make certificate ps > /tmp/ssl-rand; date >> /tmp/ssl-rand; RANDFILE=/tmp/ssl-rand /usr/local/ssl/bin/openssl req -config ../SSLconf/conf/ssleay.cnf -new -x509 -nodes -out ../SSLconf/conf/httpsd.pem -keyout ../SSLconf/conf/httpsd.pem; ln -sf httpsd.pem ../SSLconf/conf/`/usr/local/ssl/bin/openssl x509 -noout -hash < ../SSLconf/conf/httpsd.pem`.0; rm /tmp/ssl-rand Using configuration from ../SSLconf/conf/ssleay.cnf Generating a 1024 bit RSA private key ....................................................++++++ ............................++++++ writing new private key to '../SSLconf/conf/httpsd.pem' ----- 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) [GB]:JP State or Province Name (full name) [Some-State]: Locality Name (eg, city) []: Organization Name (eg, company; recommended) []:WIDE Project Organizational Unit Name (eg, section) []:moCA server name (eg. ssl.domain.tld; required!!!) []:moca.aist-nara.ac.jp Email Address []:taiji-k@is.aist-nara.ac.jp # ls ../SSLconf/conf c243e180.0@ httpd.conf httpsd.pem mime.types@ ssleay.cnf #
1. WWWサーバの公開鍵情報 X.509証明書形式を Base64で符号化した形式 X.509 の Subject には以下を含めること。 - Common Name = WWWサーバのホスト名(FQDN形式) - Country = JP - Organization = WIDE Project - Organizational Unit Name = 所属組織名(アルファベット及び数字) サーバのホスト名が xxx.wide.ad.jp である場合には必要ありません。 ※Subjectが上記の条件と違う場合は、3,4で補足すること 2. 管理者情報(必須) - 管理者の氏名 - 管理者の電話番号 - 管理者の電子メールアドレス 3. WWWサーバのホスト名 1 で WWWサーバの公開鍵情報の中にホスト名が含まれていない場合に必 要。FQDN形式。 4. 証明書の subject として希望する 国名、組織名、所属名(オプショナル) 1 で WWWサーバの公開鍵情報の中の subject とは違う subject にした い場合に必要。 とはいっても、Organization = WIDE Project, Common Name = WWWサーバのホスト名(FQDN形式) というのは変えられな い。サーバのホスト名が xxx.wide.ad.jp でない場合には、Organizational Unit Name に所属組織名(アルファベットと数字)が必要。 例: CN=hoge.wide.ad.jp, OU=Certification Authority, O=XXX Corp, C=JP 5. 入れて欲しい拡張フィールド(オプショナル) 特にあれば、書く。 - netscape cert type - key Usage - CRLDistributionPoints etc.