How to Use a Cipher Suite That is Not in the Default List 7
RSA BSAFE SSL-J 6.2.6 Troubleshooting Guide
How to Use a Cipher Suite That is Not in the Default List
As weaknesses are found in cryptographic algorithms, such as RC4, and as computers
get faster and algorithms no longer support keys of sufficient strength, such as DES,
some cipher suites that have previously been commonly used are no longer considered
secure. These cipher suites are, by default, not enabled in recent versions SSL-J.
It may be necessary to enable a cipher suite that is not enabled by default in order to
interoperate with legacy systems or to accept connections from legacy clients, such as
devices that are not able to be updated. The JSSE and SSLJ APIs both allow the set of
enabled cipher suites to be changed by specifying the complete list of enabled cipher
suites; all other cipher suites are disabled.
The following examples demonstrate how to change the enabled cipher suites by
selecting two, and only two, cipher suites to be enabled.
SSL-J JSSE Provider
If using the SSL-J JSSE provider, invoke setEnabledCipherSuites() on each
newly created
SSLSocket, SSLServerSocket, or SSLEngine object, specifying
the required cipher suites.
For example, after creating and initializing
ctx, an SSLContext:
// Get the SocketFactory from the SSLContext.
SSLSocketFactory factory = ctx.getSocketFactory();
// Create an SSLSocket and connect it to the server.
socket = (SSLSocket) factory.createSocket(HOSTNAME, PORT);
// Set the enabled cipher suites.
String[] cipherSuites = {
"TLS_ECDHE_RSA_WITH_RC4_128_SHA",
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"
};
socket.setEnabledCipherSuites(cipherSuites);
// Use the Socket.
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
For more information, see the following JSSE cipher suite and TLS protocol server
samples:
• jsse/client/CipherSuiteAndProtocol.java
• jsse/server/CipherSuiteAndProtocol.java
To view these samples in the RSA BSAFE SSL-J Developers Guide, go to
Welcome to the SSL-J Toolkit > JSSE Samples > Client Server Configuration and
select the required sample.