• Home »
  • »
  • Use OpenSSL to Verify the Contents of a CSR Before Submitting For a SSL Certificate

Use OpenSSL to Verify the Contents of a CSR Before Submitting For a SSL Certificate

When purchasing SSL certificates for your website online you will be required to generate a SSL CSR, or Certificate Signing Request, to obtain a SSL CRT, or Certificate. In the process of generating your CSR you will be required to provide numerous pieces of information including Country, State, City, Company, Department, server common name, contact email address, and a challenge password. The most important field being the server common name as this is the domain that will securely serve web pages over HTTPS to make sure data is encrypted in each direction and because of this is secure.

On numerous occasions I have accidentally fat fingered the domain or not included www. when it was required, etc. It is possible to resolve some of these issues by reissuing the certificate however it can really be a pain so it is a much better policy to double and triple check the contents of the CSR before submitting to the SSL certificate provider. Use the information below to generate the CSR using openssl on a server running Apache with modssl and then use openssl to spit back the contents of the CSR you generated to verify the contents are correct.

Generate Key With OpenSSL:


  1. openssl genrsa -out test.key 1024

Output From Generating a SSL Key with OpenSSL:


  1. Generating RSA private key, 1024 bit long modulus
  2. .++++++
  3. ........................++++++
  4. e is 65537 (0x10001)

Generate CSR Using OpenSSL Via The Above SSL Key:


  1. openssl req -new -key test.key -out test.com.csr

Questions Answered While Generating a CSR With OpenSSL:


  1. You are about to be asked to enter information that will be incorporated
  2. into your certificate request.
  3. What you are about to enter is what is called a Distinguished Name or a DN.
  4. There are quite a few fields but you can leave some blank
  5. For some fields there will be a default value,
  6. If you enter '.', the field will be left blank.
  7. -----
  8. Country Name (2 letter code) [GB]:US
  9. State or Province Name (full name) [Berkshire]:Kentucky
  10. Locality Name (eg, city) [Newbury]:Louisville
  11. Organization Name (eg, company) [My Company Ltd]:QuestionDefense
  12. Organizational Unit Name (eg, section) []:IS
  13. Common Name (eg, your name or your server's hostname) []:www.test.com
  14. Email Address []:test@example.com
  16. Please enter the following 'extra' attributes
  17. to be sent with your certificate request
  18. A challenge password []:
  19. An optional company name []:

The contents of the test.com.csr file is what will be submitted to obtain a SSL Certificate (.crt) file which will provide secure communications between your web site and customers computers. Before submitting the file and going through the confirmation process for the CRT file use the command below to verify the contents of the CSR file.

Command to Verify Certificate Signing Request (.CSR) Contents:


  1. openssl req -noout -text -in test.com.csr

Output of The Above Command Verifying the CSR Contents:


  1. Certificate Request:
  2. Data:
  3. Version: 0 (0x0)
  4. Subject: C=US, ST=Kentucky, L=Louisville, O=QuestionDefense, OU=IS, CN=www.test.com/emailAddress=test@example.com
  5. Subject Public Key Info:
  6. Public Key Algorithm: rsaEncryption
  7. RSA Public Key: (1024 bit)
  8. Modulus (1024 bit):
  9. 00:bc:04:de:e4:80:dc:58:3b:d0:01:be:3b:11:47:
  10. 8c:6f:7d:33:3d:13:33:ba:11:25:13:b1:78:11:17:
  11. d2:8f:2d:fe:d7:8e:e5:56:6e:79:fc:90:9e:e9:38:
  12. 0e:44:df:a6:6d:5c:35:89:fc:04:64:21:21:43:c8:
  13. 3d:47:18:20:6f:e5:ad:46:f8:28:56:98:1f:e2:36:
  14. 82:2d:b2:30:3f:42:37:90:61:11:f5:7b:14:7b:52:
  15. ae:c7:0c:fe:d5:46:f5:38:82:67:b2:f2:37:45:25:
  16. 34:a5:6a:ee:e5:16:d4:f8:ce:2a:e1:22:a7:ec:29:
  17. 0b:92:b0:77:25:c0:57:c1:0d
  18. Exponent: 65537 (0x10001)
  19. Attributes:
  20. a0:00
  21. Signature Algorithm: sha1WithRSAEncryption
  22. 35:5b:8c:9e:21:73:c8:b6:50:f7:d2:1f:a4:ce:b7:21:3f:d6:
  23. 76:53:d3:df:ed:73:59:a9:23:cc:e0:16:cb:38:95:8c:aa:f0:
  24. d6:3b:73:f8:5f:e7:1c:8e:ee:57:6e:0a:b8:db:7e:64:29:71:
  25. cc:88:4b:ed:c4:87:b5:a6:cb:0f:01:de:74:bd:8e:84:b5:00:
  26. 5f:aa:be:6b:a5:57:e8:56:9d:fb:a6:57:6a:ce:e1:81:c5:6b:
  27. bb:c5:90:78:86:35:d5:8d:70:e3:78:17:07:ff:44:09:6e:90:
  28. da:d4:88:f0:08:04:cf:d7:46:a0:3a:ee:e5:6a:d7:c4:7c:cf:
  29. 45:79

Notice the fourth line includes the data you need verify before submitting for a SSL certificate. The most important bit of information is the CN or common name which in the example above is www.test.com. Spending the little bit of time to verify this information can save you a lot of trouble trying to resolve any problems later.

Linux Administration: A Beginner’s Guide, Fifth Edition (Paperback)

List Price: $39.99
New From: $15.93 USD In Stock
Used from: $2.94 USD In Stock

>>> RapidSSL Certificates From Narfonix:
>>>$24.95/yr. or $43.90/2 yrs.