So this video explains how https works. What I don’t get is what if a hacker in the middle pretended to be the server and provided me with the box and the public key. wouldn’t he be able to decrypt the message with his private key? I’m not a tech expert, but just curious and trying to learn.

  • ferret
    link
    English
    226 days ago

    It is trivial for an attacker to make self-signed TLS certs, and you can absolutely just click “continue” on sites that use them when you get a warning from the browser

      • Cras
        link
        fedilink
        English
        326 days ago

        Firefox, Chrome, Edge, will all warn you about self-signed certs or cert mismatches but allow you to continue. You’re completely correct that SSL/TLS needs a certificate, but it doesn’t need to be CA issued or in any way legitimate for the encrypted tunnel to be established

      • ferret
        link
        English
        226 days ago

        I am personally using firefox and referencing my own servers that use their own self-signed TLS certs that I have not bothered to load onto my pc because they aren’t public, but chromium-based browsers aren’t some outlier here

        • zeluko
          link
          fedilink
          126 days ago

          Your own servers probably also dont have HSTS enabled, or clicking continue will be disabled (if not overwritten in your browser-config)

          • ferret
            link
            English
            126 days ago

            Reading the HSTS spec, it doesn’t work on first connection, and while most people are using websites they access more than once, that notably isn’t all web use.

            • zeluko
              link
              fedilink
              2
              edit-2
              25 days ago

              Indeed, not classically, but there are HSTS preload lists you can put your domain into which will be downloaded by supported browsers.
              And via HSTS you can include all your subdomains, which would then force proper TLS connections for those you havent visited before too.

              With the new TLS1.3 version we are getting the HTTPS / “SVCB” Record which not only allows ECH but also indicates to the client similar protection policies like HSTS. (RFC 9460)
              ECH will then make such attacks impossible on TLS-level, assuming DNSSEC is used and client can make an integrity-checked lookup e.g. via DoH/DoT or validating DnsSec themselves.
              The strength of this depends on the security-chain you want to follow of course. You dont need DNSSEC, but then the only integrity-check is between DNS-Service and Client if they use DoH/DoT (which is usually enough to defeat local attackers)