Pages

Thursday, December 19, 2013

javax.net.ssl.SSLException: No available certificate corresponds to the SSL cipher suites which are enabled.

javax.net.ssl.SSLException: No available certificate corresponds to the SSL cipher suites which are enabled.
 
I was working with SSL Server, Client Programming in Java.While working , I got the following error
w.r.t SSLServer.
 
javax.net.ssl.SSLException: No available certificate corresponds
to the SSL cipher suites which are enabled.
 
The Solution is  :
 
W.r.t Server:
 
SSLServerSocketFactory sslServerSocketfactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
SSLServerSocket sslServerSocket = (SSLServerSocket) sslServerSocketfactory.createServerSocket(intSSLport); 
final String[] enabledCipherSuites = { "SSL_DH_anon_WITH_RC4_128_MD5" };
sslServerSocket.setEnabledCipherSuites(enabledCipherSuites); 

 
W.r.t Client

SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslSocket = (SSLSocket) sslsocketfactory.createSocket(strServerName, intSSLport);
final String[] enabledCipherSuites = {"SSL_DH_anon_WITH_RC4_128_MD5"};
sslSocket.setEnabledCipherSuites(enabledCipherSuites);

 
Add this Code at Client and Server.

 
 
Reference:

http://rgrzywinski.wordpress.com/2004/08/03/dont-forget-to-set-the-cipher-suite/

No comments:

Post a Comment