I recently read the best explanation of HTTPS I have seen, highly recommended!
After reading the article, there was only one thing left unclear to me, so I asked the author, Jeff Moser, and he responded:
Me:
Just one thing is really unclear to me - DNS poisoning: The attacker obtains certificate from amazon.com, I enter "amazon.com" to browser, browser goes to attacker's site, which responds by valid amazon.com certificate signed by Verisign. How does the browser tell this is an attack?
Jeff:
Great question! Note that if an attacker did this, they'd run into trouble in the "Trading Secrets" section that I described. Without knowing Amazon.com's private key, they couldn't decrypt the pre-master secret that the client sends out because the certificate from Verisign has Amazon's public key. Thus, the client would use that public key (and not one an attacker generated).
To be clear, DNS poisoning is an attack when attacker fools your DNS server. You type "amazon.com" in the browser, and to connect to the right machine in the world, the URL has to be translated to IP address. This is the purpose of your DNS server. Since the DNS server is poisoned, it returns attacker's IP address and you connect to attacker's server - quite nasty.
Now everything is 100% clear, thanks Jeff!

