As I understand the original master key, which is used to encrypt the application data is never transmitted over the wire and it is calculated on both client and server individually using a hashing-alike function which takes the following as input:
- Client Random
- Server Random
- Pre-master key encrypted with Server's public key.
If a man-in-the-middle captures the TLS handshake packets and if he somehow has the server's private key, then will he be able to generate the master key? So, is the server's private key the only protection against the man-in-the-middle attack?
What happens in mTLS, where client also shares its certificate(public key)? Will it change the way the master key is generated?