# openssl req -x509 -new -config openssl.cnf -key private/cakey.pem -out cacert.pem -set_serial 0 -days 3650 Enter pass phrase for private/cakey.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) [AU]:TW State or Province Name (full name) [Some-State]:.Taiwan Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]:example company Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:example.com Email Address []:mail@example.com
# openssl req -new -key private/ocsp.key -addext 'extendedKeyUsage = critical, OCSPSigning' -out requests/ocsp.csr 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]:TW State or Province Name (full name) [Some-State]:Taiwan Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]:example company Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:ca.example.com Email Address []:
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
# openssl ca -in requests/ocsp.csr -config openssl.cnf -out certs/ocsp.pem Using configuration from openssl.cnf Enter pass phrase for /root/ca/private/cakey.pem: Check that the request matches the signature Signature ok Certificate Details: Serial Number: 1 (0x1) Validity Not Before: xxxxx Not After : xxxxx Subject: countryName = TW stateOrProvinceName = Taiwan organizationName = example company commonName = ca.example.com X509v3 extensions: X509v3 Basic Constraints: CA:FALSE X509v3 Subject Key Identifier: xxxxx X509v3 Authority Key Identifier: xxxxx Certificate is to be certified until xxxxx (365 days) Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries
SHELL
證書會輸出到certs/ocsp.pem
啟動ocsp responder
1
# openssl ocsp -index index.txt -CA cacert.pem -rsigner certs/ocsp.pem -rkey private/ocsp.key -port <the port to listen> -text