I am hosting the same website in two locations:
- A public location
- A location on a LAN with local DNS
mysite.com is a service which targets users with very poor connectivity and
mysite.local is a clone of the same service. My goal is that the local version can serve as a transparent backup when connectivity to
mysite.com is poor.
So my user navigates to
mysite.com in Chrome. Usually, the content is served from AppCache. In script, it checks if
mysite.local is available. If so, if the connection to it is secure. If so, I use
mysite.local as the backend for the session (including writing private user data). If not, I attempt to use the public
I'm planning to use
openssl to self-sign a CA certificate and use that to produce a certificate for
mysite.local. The web server (nginx) accepts only HTTPS requests and uses that cert. I provide steps for my user to add the public key from my CA certificate into their list of trusted CAs. They trust me and have no problem doing this.
I'm aware that an attacker on another LAN network could setup a local DNS and make their own
mysite.local, but it would be difficult for them to get a trusted certificate for that domain on my user's device.
Am I putting my user's data at risk with this sort of configuration? How can I improve it?