SSL TLS CSR

CSR stands for Certificate Signing Request. Its a process where by you generate a certificate to be signed by a certificate authority.

To generate the CSR you would need to create the CSR, when creating the CSR you would get 2 files. The .CRT file is the certificate itself to be signed. The .KEY file is the private keys and this should be kept to yourself only.

openssl req -newkey rsa:4096 -keyout mysuperweb.key -out mysuperweb.csr

For our files we will have something similar to the following, we will only show a fragment of the files as they are very long. 

mysuperweb.key

-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIJjjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIgaiCWiYNy/YCAggA
MBQGCCqGSIb3DQMHBAiC7N4CId465gSCCUhmrLZaXat8niANfa/Yc3ikzPB9/RXF
VCIwPGMMgCNNO/riGW7HFQPmP8zefe82nndSVkmoUt2rQDcBozj0tTkiHNz/9fON
nh1149bKZWsq33WRUZilumN0ZzVSIwZELNjR10DPHm4ndoMtXGTJQB3WLCWgfL/6
1jOgnTyq4CmFB4tfhoI6Ztjt64kfT+jDa9PGpLOt33/Za0D1CrEeX7EPGuDY+uep
cr+vvXAjvaasRpw7Z+IXEbNtZScfIFtsEdyiPYOWNxU7WKDeWTpdbIPuQiGD5pSO
xrOTlTIkFk0ohKQ3bPOGMIHkGcuLaP+5KP5bsdBQksP6v0FpxDvlL95o+g/CHQ/4
BxA1wrGjpOtusanPH6FfVbcb1xoQ9s73aOwio1RJi0j8ZvSOYH9fJol8rVQELiWP
fmD8BW80//QK67oSDEzexuSRLVIX5IihjdrN3ZKbLp9qncx9KBwfWOeM/eV7V6xc
Zr+SAy+KHM925epPaMecMWkn+ADKYmX9TdDF8GIp4lreEvPJjhrAzPcQVZJDeBOW
-----END ENCRYPTED PRIVATE KEY-----

mysuperweb.csr


-----BEGIN CERTIFICATE REQUEST-----
MIIEljCCAn4CAQAwHzEdMBsGA1UEAwwUc3lzLm15c3VwZXJ3ZWIuY28udWswggIi
MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDC4W98qtYU7/szmH8eAsfkW+jE
dYHMyyTsrmDcAFT+MKzcTu2zLN34jJ+8BWS7uW3+/M+v2qurXq6ounHC726iHlOD
z4LGxCmKOWc6OMfpEes7fcdEUEE2Rn6V0jw2nz/8WqJnegQ8B/o2diTbA7z+/5iD
T3ipgzT/cF1Aqt6fcRCx2d+vyDBlw8tsn6ErhHwjVzqwHNAI+uKp7VqlOrR1Yqlx
LBd6L7jmG2q8dnmuAI0TgVIQA0TUeIsixOD/Rbi/8Gk4xKoa6oU9cILMbIt+GzZ2
-----END CERTIFICATE REQUEST-----

If you wish to have the private non-encrypted then you can run the following command instead.

openssl req -new -newkey rsa:4096 -sha256 -nodes -out mysuperweb.csr -keyout mysuperweb.key

When filling out additional information, for the Country code, it would be set as GB, rather than UK due to the ISO 3166 standard.

Here is the command for auto filling of the fields:

openssl req -new -newkey rsa:4096 -sha256 -nodes -out mysuperweb.csr -keyout mysuperweb.key -subj "/C=GB/ST=London/L=London/O=mysuperweb/OU=Infrastructure Operations/CN=mysuperweb.co.uk"