Unencrypted SSL protocol?

2019-04-26 15:12发布

Is it possible to send a message over https that isn't encrypted? For example, require that certificate validation and authorization occur, but not encrypt the actual data being sent over the socket?

4条回答
对你真心纯属浪费
2楼-- · 2019-04-26 15:43

Yes, TLS and SSL support "no-encryption" modes. Whether the particular client and server in question are configured to enable is a separate issue.

It's possible, though unlikely, that a server could enable one of these cipher suites by default. What is more likely is that a server would enable weak cipher suites (like the "export"-grade DES-based suites) by default. That's why you should carefully review the server's whitelist of cipher suites, and leave only a few trusted, widely-supported algorithms.

You can use the TLS_RSA_WITH_NULL_SHA cipher suite, among others, to protect the authenticity and integrity of traffic, without encryption.

The "RSA" in this case refers to the key exchange algorithm, while "SHA" refers to the message authentication algorithm used to protect the traffic from being altered. "NULL" is the encryption algorithm, or, in this case, the lack of encryption.

It's important to realize that the traffic, though it's not encrypted, is bundled up in SSL records. The client and server must be SSL-enabled.

If you are looking for a step-down solution where some data is exchanged over SSL, then SSL is turned off but the application traffic continues, that's possible too, but keep in mind that it offers absolutely no security for the cleartext traffic; it can be tampered with by an attacker. So, for example, authenticating with SSL, then stepping down to an "in-the-clear" protocol to receive commands that use the authentication negotiated via SSL would unsafe.

查看更多
叛逆
3楼-- · 2019-04-26 15:50

I think you can.

but it would be stupid, you will loose the point of the authentication, and leave yourself exposed to attackers that can intercept and alter your packets.

查看更多
Root(大扎)
4楼-- · 2019-04-26 15:51

The SSL/TLS specs define a "NULL cipher" which you could use for this. Most client and server software disable it for obvious reasons.

However, if you are writing your own software, you may be able to convince your library to negotiate it.

查看更多
淡お忘
5楼-- · 2019-04-26 16:03

No, the protocol doesn't allow for that.

One solution you could do is connect over https, verify the connection, then drop subsequent connections to HTTP with a session cookie. Without that cookie, redirect back to https so that the client always connects over it.

This might not be relevant to you, though, so if you provide more information about the problem you're trying to solve we could be of more help.

查看更多
登录 后发表回答