Routing to an IP in the local network obviously doesn't work outside that local network.
Re-routing the domain to the local machine (by editing /etc/hosts) should work just the same. A certificate from a trusted CA can be validated without an internet connection, they are part of the OS/Browser distribution.
How do you make it work if you are working offline, say in a plane ?