Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are right, <code>*_anon_*</code> ciphers are used for a complete unauthenticated connection (both server and client are anonymous). With these cipher suites no certificate is required. I wrote a small code to test:</p> <pre><code>ServerSocketFactory sf = SSLServerSocketFactory.getDefault(); final SSLServerSocket socket = (SSLServerSocket)sf.createServerSocket(443); System.out.println(Arrays.toString(socket.getSupportedCipherSuites())); System.out.println(Arrays.toString(socket.getEnabledCipherSuites())); socket.setEnabledCipherSuites(new String[] {"SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA"}); Thread t = new Thread() { public void run() { try { Socket client = socket.accept(); client.getOutputStream().write("Hello World\n".getBytes("ASCII")); client.close(); } catch (IOException ioe) { } } }; t.start(); Thread.sleep(2000); SSLSocket client = (SSLSocket) SSLSocketFactory.getDefault().createSocket("localhost", 443); client.setEnabledCipherSuites(new String[] {"SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA"}); InputStream in = client.getInputStream(); byte[] data = new byte[1024]; int len = in.read(data); System.out.println(new String(data, 0, len)); </code></pre> <p>I know that this code is not perfect but I successfully exchange data between the client and the server. Maybe your server or client socket is not well configured. Can you give the full stacktrace you got?</p> <p>Note that these ciphers are deprecated since there are vulnerable to man-in-the-middle attacks. </p> <p><strong>UPDATE</strong> : I found the issue. The <code>anonCipherSuitesSupported</code> array length is too long. Therefore after adding the <code>*_anon_*</code> the array is ending with a bunch of <code>null</code> values. And the implementation does not seem to accept <code>null</code> in the enabled cipher list.</p> <pre><code>String[] supported = server.getSupportedCipherSuites(); List&lt;String&gt; list= new ArrayList&lt;String&gt;(); for(int i = 0; i &lt; supported.length; i++) { if(supported[i].indexOf("_anon_") &gt; 0) { list.add(supported[i]); } } String[] anonCipherSuitesSupported = list.toArray(new String[0]); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload