Centos: Create new SSL certificate for https

  1. Generate a new certificate signing request (.csr) and key file (.key)

    openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

    where server is the name of your server

  2. Fill in the details but you can leave email, challenge password and optional company name blank. Please note: The following characters cannot be accepted: < > ~ ! @ # $ % ^ / \ ( ) ?.,&
  3. Chek the contents of the csr:  https://www.sslshopper.com/csr-decoder.html  or enter this in the SSH console:

    openssl req -in server.csr -noout -text

    (again where server.csr is the name of the newly genererated csr file)

  4. Submit csr to commercial ssl provider.
  5. Copy the new certificate information into the correct location for the host.  You may need to look at the virtual host settings or apache config file to see where an existing one is. * See below
  6. Do the same for the intermediate certificate file if there is one.
  7. Move (or copy) the key
  8. Change the apache (or virtual host) config file to point at the new certificates.
  9. Restart the webserver.  For Debian this is “service apache2 restart”.  For Centos this would be “service httpd restart” or “systemctl restart httpd” for newer Centos versions.
  10. Make sure the server restarts – any typos in the config will stop it from running – you will be notified.

Additional resources:

Country Codes: https://www.digicert.com/ssl-certificate-country-codes.htm




Check they are working correctly: https://www.sslshopper.com/ssl-checker.html