2 ms·
In order to encrypt the connection handshake, you and the server need to agree on a key to encrypt it with. If you do the key exchange on the connection, you h
by toast0 6y ago
In order to encrypt the connection handshake, you and the server need to agree on a key to encrypt it with.
If you do the key exchange on the connection, you have two choices:
a) anonymous key exchange, which could be MITM, because it's unauthenticated. This would be more secure than just sending the hostname in plain text, because it would require active interception rather than passive surveillance, but active interception is not that much harder than passive surveillance.
b) signed key exchange, which is tricky, because the server may have certificates for many hostnames, and it doesn't know which one you used
In order to have another option, you need to get a key through some other method. DNS is the more or less the most viable out of band method to get that information; after all, it's what you used to turn a hostname into an IP address to contact the server in the first place.
- namibj 6y agoYou could do (a) to force active attacks, and then at the end (after SNI) authenticate the server based on the then-matching cert, followed by checking that you both got the same symmetric key from the ECDH key exchange at the beginning. If they don't match, you know there was an active MITM and both sides know.