To apply for a certificate, an electronic application file is required, summarizing the necessary information that will later appear on the certificate. This file is also known as a Certificate Signing Request (CSR). It is uploaded to the certification authority as part of the actual application process.
A widely used tool for generating CSR files and key pairs is the software OpenSSL. OpenSSL is available as a package in many Linux systems and is often pre-installed as part of the base installation. OpenSSL is also available for Windows and can be installed there. It is crucial that the system on which cryptographic keys are generated is trustworthy. The private key, in particular, must be strictly protected, as it verifies the rightful owner of the certificate and if compromised could lead to identity theft.
To avoid cluttering the command line, several settings are moved to a configuration file called 'cert.conf', which must be located in the same folder. In the template on this page, simply replace the placeholders HOSTNAME and SUBDOMAIN. For example, for a wiki server operated by the data center, this would be wiki.rz.tuhh.de. Additionally, the list under alt_names needs to be adjusted.
Creating an application file requires certain information, which can be passed to OpenSSL as command-line parameters. However, to avoid cluttering the command line, many of these settings can be moved to a configuration file called 'cert.conf'. Furthermore, a configuration file created once can be reused when renewing the certificate.
The following block can be copied into a simple text file named cert.conf. The placeholders HOSTNAME, HOSTNAME2, and SUBDOMAIN must be adjusted accordingly. I.E. for a wiki server operated by the computer center, this would be wiki.rz.tuhh.de. Additionally, the list under alt_names must be adjusted. The server's common name is repeated in the DNS.0 entry.
[ req ]
prompt = no
distinguished_name = req_distinguished_name
req_extensions = req_exts
[ req_distinguished_name ]
countryName = DE
stateOrProvinceName = Hamburg
localityName = Hamburg
organizationName = Technische Universitaet Hamburg
commonName = HOSTNAME.SUBDOMAIN.tuhh.de
[ req_exts ]
subjectAltName = @alt_names
[ alt_names ]
DNS.0=HOSTNAME.SUBDOMAIN.tuhh.de
DNS.1=HOSTNAME.SUBDOMAIN.tu-harburg.de
DNS.2=HOSTNAME.SUBDOMAIN.tu-hamburg.de
DNS.3=HOSTNAME2.SUBDOMAIN.tuhh.de
DNS.4=HOSTNAME2.SUBDOMAIN.tu-harburg.de
DNS.5=HOSTNAME2.SUBDOMAIN.tu-hamburg.de
Additional aliases can be added under alt_names, numbered sequentially. In the example above, there is a second hostname. Both are registered for the TUHH domains (tuhh.de, tu.harburg.de, tu-hamburg.de).
Since Harica currently does NOT take into account the aliases (i.e., the extensions called 'Subject Alternative Name') from the CSR file, when using the web forms later, you will have to either manually enter the aliases again OR upload a correspondingly prepared list as a CSV file.
Following the 'cert.conf' example above, the CSV file would look simple and single-column as follows:
DNS-Name
HOSTNAME.SUBDOMAIN.tuhh.de
HOSTNAME.SUBDOMAIN.tu-harburg.de
HOSTNAME.SUBDOMAIN.tu-hamburg.de
HOSTNAME2.SUBDOMAIN.tuhh.de
HOSTNAME2.SUBDOMAIN.tu-harburg.de
HOSTNAME2.SUBDOMAIN.tu-hamburg.de
In the directory where the configuration file cert.conf is stored, you can now generate a new key pair and the CSR file using the following command.
openssl req -config cert.conf -sha256 -newkey rsa:3072 -keyout pkey.pem -out csr.pem
The OpenSSL command contains the following parameters: