Then you need a public domain where you control the DNS.
Use Let’s Encrypt - it is easy to setup - and you can use certbot with the apache plugin to handle the setup.
I develop webapps using dotnet core - it is easy to create a dev cert which works for localhost
dotnet dev-certs https