PHP server-side and Javascript client-side: How to detect a man-in-the-middle-attack or deep-packet-inspection ?
I want to add an extra layer of security on a website. I am using a letsencrypt ssl certificate on my linux server. A legitimate user accesses my website using https, but he is not in control of the (company issued) device/browser he is using. It might be, that an extra ssl certificate has been added to his browser to enable a man-in-the-middle-attack or deep-packet-inspection e.g. at the firewall. If this is the case, a warning or some alternative content should be echo'ed in PHP. I am thinking along the line of client-side Javascript sending back to the server some data about the certificate in use at the browser and then comparing this to the certificate data visible at the server.
I am aware, that a very dedicated man-in-the-middle could fabricate all communication and change the Javascript code at the client and then detection would be impossible. But I want to make it to detect 'common'/'simple'/'standard tools using' man-in-the-middle-attack or deep-packet-inspection.