0

Can a website check in the application layer which key/certificate the client is using? Somehow detect that the certificate is not the real one, but issued by Sneakycorp Inc. because a man-in-the-middle attack is in progress.

I realize that the mitm could fake the response, but that raises the bar for simple copying proxies.

Leif Neland
  • 1,416
  • 1
  • 17
  • 40

1 Answers1

1

I see two possibilities:

Use code on client side

Use code on client side (e.g. JavaScript) to read the used certificate and send the info back to the server. Then on server side you could compare if the used certificate is the expected one.

It seems like in JavaScript it is not that easy to get the necessary info on the certificate. The used method in the linked answer seems to be Firefox only at the moment.

TLS fingerprinting

A second way is used by large content delivery sites: HTTPS fingerprinting Based on the TLS headers you can generate a fingerprint on TLS stack and often also on the used technology/run-time and OS like .Net, Java, Python, and so on. If you then compare that with what you expect e.g. based on the user agent you can calculate the chance that you have a direct connection or if some man-in-the-middle server is active.

Robert
  • 39,162
  • 17
  • 99
  • 152