This question already has an answer here:
I am trying to set up a development environment that mirrors my live server, but behind the firewall.
Until fairly recently my shared hosting site didn't offer TLS/SSL so it wasn't an issue/option, but now that encryption is the norm I need to reconfigure my development environment.
In the past, I had a Ubuntu server running in a container on my workstation (configured with Webmin) with the same domain name (ex: example.com) and directory structure as the live server. I put an entry for example.com in my /etc/hosts file so that my web browser would hit the local server instead of the live server. This allowed me to perfectly stage my WordPress site and then deploy to the live server with simple copy operations and not have to use "migration plugins" which not only cost money, but may also introduce errors.
My problem is that now I need to correctly mimic the operation of TLS (locally) to be able to run/test my WordPress sites.
The "live" site example.com uses a "Let's Encrypt" wildcard certificate, (so I can't use Let's Encrypt in any way without messgin the live site up) but for the development it would be quite acceptable to have a self-signed certificate of some kind as long as it's good enough that I can "add exception" to the browser. I don't need to allow anyone outside the firewall to visit the development/staging site - the site only needs to be able to "call out" to pick up updates to plugins and themes.
All the examples I have seen either describe setting up Let's Encrypt or setup as localhost, but nothing on "spoofing" a server.
Is this possible?