-
Notifications
You must be signed in to change notification settings - Fork 139
Generating Certificate Request with OpenSSL
Endi S. Dewata edited this page May 22, 2023
·
5 revisions
To generate a certificate request with a new key:
$ openssl req \ -new \ -newkey rsa:2048 \ -nodes \ -keyout testuser.key \ -subj "/UID=testuser/DC=example/DC=com" \ -out testuser.csr
To generate a certificate request with an existing key:
$ openssl req \ -new \ -key testuser.key \ -nodes \ -subj "/UID=testuser/DC=example/DC=com" \ -out testuser.csr
To generate a certificate request with an empty subject and a SAN extension, specify the extension in a configuration file (e.g. sslserver.conf
):
[req] req_extensions = req_ext [req_ext] subjectAltName = @alt_names [alt_names] DNS.1 = www.example.com DNS.2 = pki.example.com
then generate the certificate request as follows:
$ openssl req \ -new \ -newkey rsa:2048 \ -nodes \ -keyout sslserver.key \ -subj "/" \ -out sslserver.csr \ -config sslserver.conf
To verify the certificate request:
$ openssl req -text -noout -in <filename>
Tip
|
To find a page in the Wiki, enter the keywords in search field, press Enter, then click Wikis. |