SSLSocketTest: add test with no ciphers

If there are no ciphers set, there should just be a handshake failure.
However, Conscrypt was throwing InvalidArgumentException in this
configuration.

Bug: 21195269
Change-Id: I73cfc4927041ca9b1331b58859382573e7de6f63
diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
index 89b05f3..7e05054 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
@@ -420,6 +420,37 @@
         c.close();
     }
 
+    public void test_SSLSocket_NoEnabledCipherSuites_Failure() throws Exception {
+        TestSSLContext c = TestSSLContext.create(null, null, null, null, null, null, null, null,
+                SSLContext.getDefault(), SSLContext.getDefault());
+        SSLSocket client = (SSLSocket) c.clientContext.getSocketFactory().createSocket(c.host,
+                c.port);
+        client.setEnabledCipherSuites(new String[0]);
+        final SSLSocket server = (SSLSocket) c.serverSocket.accept();
+        ExecutorService executor = Executors.newSingleThreadExecutor();
+        Future<Void> future = executor.submit(new Callable<Void>() {
+            @Override
+            public Void call() throws Exception {
+                try {
+                    server.startHandshake();
+                    fail();
+                } catch (SSLHandshakeException expected) {
+                }
+                return null;
+            }
+        });
+        executor.shutdown();
+        try {
+            client.startHandshake();
+            fail();
+        } catch (SSLHandshakeException expected) {
+        }
+        future.get();
+        server.close();
+        client.close();
+        c.close();
+    }
+
     public void test_SSLSocket_startHandshake_noKeyStore() throws Exception {
         TestSSLContext c = TestSSLContext.create(null, null, null, null, null, null, null, null,
                                                  SSLContext.getDefault(), SSLContext.getDefault());