Hello Dipesh,

Good Question!!

If you need a wildcard certificate, you would still follow the same flow, except you would use a regex(*) when generating the server certificate signing request.

$ openssl req -new -key server.key -out server.csr -subj "/CN=*.xyz.com"

This will enable you to authenticate with domains *.xyz.com.

Note: xyz.com it self will not authenticate, so you will need to add it to the Subject Alternative Names:

$ openssl x509 -req -days 365 -extfile <(printf "subjectAltName=DNS:xyz.com,DNS:www.xyz.com") -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt

Some good reference on the above: https://www.idmworks.com/wildcard-ssl-certificate-in-common-name-cn/

Senior Technical Marketing @ GitLab 🦊, Developer @ home, Keeping ATX Weird 😜

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store