When I connect to a secure sever that has is equipped with SSL certificate.

Logically, the first step is the handshake to discuss the cipher suites etc.

However, the very first time my web browser does a DNS request and comes up with the location of the site, and my browser connects to the website even before starting the handshake, is this step secure (encrypted by the public key of the websites web server by getting its public key from the built in keys in the browser) or no?

Update: What I mean here, what happens the very first thing when I open the browser and type https://randomness.org the very first time my broswer (computer) and the server come in to contact. Is this connection secure?

  • $\begingroup$ Do you mean is it secure for the browser to, without any prior knowledge, to ask the server for its public key? Yes / no. This relies 100% on the root trust chain and that certificate authorities are well behaved. Past this point your only benefit is certificate pinning, which can lock the public key such that it cannot change, even if certificate authorities want to sign other certificates. Your browser will obey the pinning over CAs, but your friend who hasn't been to the site will not have this benefit as pinning is local and not shared with https: links. $\endgroup$
    – cypherfox
    Mar 12, 2018 at 14:34
  • $\begingroup$ In the same breath, if the server is compromised at any point in time, then the adversary can set the public key pinning to something the real site doesn't control, leading to a denial of service or ransom against the service. This only affects users whose browsers locked in the pinning. $\endgroup$
    – cypherfox
    Mar 12, 2018 at 14:35

1 Answer 1


If we assume that DNS (DNSSEC) and IP (BGP) are well behaved, deployed and used correctly then so far so good. You should be reaching the intended server.

If however there is an adversary between you and this server, then they may interfere with the TLS handshake, including but not limited to altering the chosen ciphersuites and public keys. Any alterations are detectable when we pass the certificate verification, key exchange and authentication steps. However if the client doesn't do all the correct verifications, they may be vulnerable to Moxie's sslstrip tool, which performs various attacks.

  • $\begingroup$ BGP well behaved, haha that's a good one. $\endgroup$
    – forest
    Apr 12, 2018 at 1:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.