I have a question: is it possible to go through the ssl handshake
process between a client and a server, and after the handshake is
complete to stop using ssl and switch to plaintext?
Thanks,
Yariv
This question can be answered in two ways I
think, although I bet others have better answers.
1. SSL includes a few cipher suites that are NULL
(have a look in your browser SSL settings to see
the full list, you'll find the NULL suites are turned
off). So after all the handshaking and what-have-
you, you could negotiate and use a NULL suite.
Both sides would have to have these turned on,
of course, as they are there for testing more than
anything and thus turned off by default.
2. Alternatively, SSL itself stops and then you
start negotiating another protocol (which is what
you need by definition). In theory, SSL is a
message passing protocol over a connection,
so when it stops, there is no problem with you
starting another protocol. But, in practice,
implementations may or may not take control
of the connection, and if they decide to bail
out, then they can close the connection. So
to know whether this is possible depends in
practice on how the implementation works, I'd
guess.
The question one would ask is why one would
want a plaintext conversation ... integrity and
identity checking over an already private net
would be one reason.
iang
--
http://iang.org/
NSS supports hose "null" encryption cipher suites.
You can use SSL_CipherPrefSetDefault or
SSL_CipherPrefSet to specify that only the "null"
encryption cipher suites are enabled:
http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html#1084747
http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html#1214758
Our documentation is out of date. In addition to
SSL_RSA_WITH_NULL_MD5, we also support
SSL_RSA_WITH_NULL_SHA. Please consult our header
file sslproto.h for the current list of supported
cipher suites:
http://lxr.mozilla.org/security/source/security/nss/lib/ssl/sslproto.h#111
An SSL connection can be closed without closing the
underlying TCP connection. Off the top of my head,
I don't know if NSS's SSL library allows you to do that.
Wan-Teh
Yariv
I've just updated our SSL documentation, so all the
SSL cipher suites implemented in NSS 3.10 are listed
in http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html
now.
Wan-Teh
Is this question hypothetical?
Or is it "how do I do this with NSS's SSL library?"
There was a time, years ago, before NSS was integrated with NSPR and the
SSL library became an NSPR I/O layer, when stopping SSL on a connection
after a handshake only required two steps:
1. set the socket's SSL_SECURITY option to 0, disabling further SSL
handshakes, and
2. call SSL_ResetHandshake to reset the SSL state machine to a
pre-handshake condition.
That might still work. But it surely hasn't been tested in over 5 years.
I think we can say that it is not a supported feature of NSS.
Another option might be to pop the SSL I/O layer off of the NSPR socket's
I/O layer stack. Normally that happens in the normal course of closing
an SSL socket. It might be difficult to close the SSL layer if you pop
it off before closing it. But I'm sure it's feasible. It's all a small
matter of programming. :)
Of course, doing this violates the SSL/TLS protocol, and leaves your
connection with absolutely no ongoing security assurances of any kind.
A connection is trivially hijacked once SSL is gone.
Don't even think about doing this in a mozilla extension!
The alternative suggested by others here, of using an SSL ciphersuite
that does no encryption at least gives you ongoing assurances of
authenticity and message integrity. It also should work OK in a mozilla
extension.
/Nelson