I am using the linux for this article. Open your terminal (command prompt.)
Now we can generate the certificate. First we generate a key:
# openssl genrsa -out server.key 2048
Next we generate a certificate signing request (CSR). This is where we can designate the wildcard. Run the command below and you will be prompted with a series of questions. When promted for Common Name, you would normally enter your domain name. We want a wildcard so enter *.mydomain.com
, replacing mydomain.com with your domain name:
#openssl req -new -key server.key -out server.csr
Finally, create the self-signed wildcard certificate (the below example is valid for a year; change the number of days to reflect how long you want the certificate to be valid):
#openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
The post How To Create a self-signed SSL Certificate for Apache appeared first on DIG into CMS.