Why not use HTTPS for everything?

后端 未结 15 1070
予麋鹿
予麋鹿 2020-12-02 07:54

If I was setting up a server, and had the SSL certificate(s), why wouldn\'t I use HTTPS for the entire site instead of just for purchases/logins? I would think it would make

相关标签:
15条回答
  • 2020-12-02 08:45

    Why not send every snail-mail post in a tamper-proof opaque envelope by Registered Mail? Someone from the Post Office would always have personal custody of it, so you could be pretty sure that no one is snooping on your mail. Obviously, the answer is that while some mail is worth the expense, most mail isn't. I don't care if anyone reads my "Glad you got out of jail!" postcard to Uncle Joe.

    Encryption isn't free, and it doesn't always help.

    If a session (such as shopping, banking, etc.) is going to wind up using HTTPS, there's no good reason not to make the whole session HTTPS as early as possible.

    My opinion is that HTTPS should be used only when unavoidably necessary, either because the request or the response needs to be safeguarded from intermediate snooping. As an example, go look at the Yahoo! homepage. Even though you're logged in, most of your interaction will be over HTTP. You authenticate over HTTPS and get cookies that prove your identity, so you don't need HTTPS to read news stories.

    0 讨论(0)
  • 2020-12-02 08:48

    If whole session is encrypted then you won't be able to use caching for static resources like images and js on proxy level eg ISP.

    0 讨论(0)
  • 2020-12-02 08:48

    Well, the obvious reason is performance: all of the data will have to be encrypted by the server before transmission and then decrypted by the client upon receipt, which is a waste of time if there's no sensitive data. It may also affect how much of your site is cached.

    It's also potentially confusing for end users if all the addresses use https:// rather than the familiar http://. Also, see this answer:

    Why not always use https when including a js file?

    0 讨论(0)
  • 2020-12-02 08:48

    In addition to WhirlWind's response, you should consider the cost and applicability of SSL certificates, access issues (it's possible, though unlikely, that a client may not be able to communicate via the SSL port), etc.

    Using SSL isn't a guaranteed blanket of security. This type of protection needs to be built into the architecture of the application, rather than trying to rely on some magic bullet.

    0 讨论(0)
  • 2020-12-02 08:49

    SSL/TLS isn't used nearly often enough. HTTPS must be used for the entire session, at no point can a Session ID be sent over HTTP. If you are only useing https for logging in then you are in clear violation of The OWASP top 10 for 2010 "A3: Broken Authentication and Session Management".

    0 讨论(0)
  • 2020-12-02 08:51

    https is more resource-hungry than the normal http.

    It demands more from both the servers and the clients.

    0 讨论(0)
提交回复
热议问题