Detecting HTTPS Interception MITM

https://caddyserver.com/docs/mitm-detection

I was wondering if anyone had some example code for displaying something like the MITM likely on a page.Or if anyone has the variables to use in the caddyfile to perform a redirect that would also be helpful.

Well, just like that docs page suggests:

  • In your Caddyfile, you can use if {mitm} is likely in redir or rewrite
  • In an HTML file (when using the templates directive), you can use {{if .IsMITM}} ... {{end}} to show content if the page is being intercepted

That particular page is rendered by a process other than Caddy (that’s just how the docs pages work, they’re rendered by the devportal, fronted by Caddy), so for now it serves a JSON response using templates: https://github.com/caddyserver/website/blob/master/site/resources/mitm.html

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.