This approach has many advantages as well as can be some pitfalls.
Being cheap, ability to secure multiple sub domains and easy to manage are some of the advantages.
At the same time, following lists few pitfalls.
Security: If one server or sub-domain is compromised, all sub-domains may be compromised.
Management: If the wildcard certificate needs to be revoked, all sub-domains will need a new certificate.
Compatibility: Wildcard certificates may not work seamlessly with older server-client configurations.
Let's see how we can create a wildcard certificate with java key tool.