There are a few ways to get a SSL cert for testing.
These work for a “real domain name”
- Buy one
- get one with your hosting
- get one from Lets Encrypt or other free cert provide
Depends on how you are hosting. What server type you are using/etc
Follow those instructions