SSL no cipher suites in common?

R

rmacnak

I'm trying to establish TLS over an existing socket, both the server
and client are running on the same machine with the same jre, but I
keep getting a "SSLHandshakeException: no cipher suites in common.", so
I was wondering how that's even possible.

Here is the server:

SSLContext context = SSLContext.getInstance("TLS");

context.init(null, new javax.net.ssl.TrustManager[]{
new OpenTrustManager()},
new java.security.SecureRandom());

Socket plain = socket;
// Secure the plain connection
socket = context.getSocketFactory().createSocket(plain,
plain.getInetAddress().toString(), plain.getPort(), true);
socket.setSoTimeout(0);
socket.setKeepAlive(true);
((SSLSocket) socket).setEnableSessionCreation(true);
((SSLSocket) socket).setUseClientMode(false);
((SSLSocket) socket).setNeedClientAuth(false);

//enable all available cipher suites
((SSLSocket)
socket).setEnabledCipherSuites(context.getSocketFactory().getSupportedCipherSuites());

((SSLSocket) socket).startHandshake(); //SSLHandshakeException: no
cipher suites in common
 
E

EJP

//enable all available cipher suites
((SSLSocket)
socket).setEnabledCipherSuites(context.getSocketFactory().getSupportedCipherSuites());

Don't do this, it's insecure: it enables insecure cipher suites.

'No cipher suites in common' means that e.g. you have an RSA certificate
that the server wants to use as its authentication, but no RSA
certificates in the client's trusstore, or vice versa.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top