As a web application developer, you can do this very little.
This problem should be considered further on the stack.
If someone halfway around the world wants to:
and. Place the false root CA on the computer.
b. Issue a certificate for your domain under this CA
with. Personalize your site
e. Give someone a local DNS record for your domain on a different ip
Your application has not participated or consulted in any of the above steps, so good network administration and security are important here.
Besides this, maybe there is a legitimate reason why someone can do this locally on their personal network. Who am I to stop them?
This, in essence, is what corporate web proxy filters do, and they are within their rights to do so.
, - , , .