diff options
-rw-r--r-- | luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java | 43 |
1 files changed, 17 insertions, 26 deletions
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 eccd2b7..c3a1eb4 100644 --- a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java +++ b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java @@ -397,35 +397,26 @@ public class SSLSocketTest extends TestCase { SSLContext.getDefault(), SSLContext.getDefault()); SSLSocket client = (SSLSocket) c.clientContext.getSocketFactory().createSocket(c.host, c.port); - // RI used to throw SSLException on accept, now throws on startHandshake - if (StandardNames.IS_RI) { - 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; + 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) { } - }); - executor.shutdown(); - try { - client.startHandshake(); - fail(); - } catch (SSLHandshakeException expected) { - } - future.get(); - server.close(); - } else { - try { - c.serverSocket.accept(); - fail(); - } catch (SSLException expected) { + return null; } + }); + executor.shutdown(); + try { + client.startHandshake(); + fail(); + } catch (SSLHandshakeException expected) { } + future.get(); + server.close(); client.close(); c.close(); } |