From: Felix Dörre Date: Wed, 25 Jun 2014 15:24:56 +0000 (+0200) Subject: Make "TestSSL" a "ManagedTest" X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=5bbd7100dcbeb1101f78a6c611d615d92de41e58 Make "TestSSL" a "ManagedTest" --- diff --git a/tests/org/cacert/gigi/TestSSL.java b/tests/org/cacert/gigi/TestSSL.java index b6d95faa..513fd2b3 100644 --- a/tests/org/cacert/gigi/TestSSL.java +++ b/tests/org/cacert/gigi/TestSSL.java @@ -13,9 +13,10 @@ import javax.net.ssl.SSLEngineResult; import javax.net.ssl.SSLEngineResult.HandshakeStatus; import javax.net.ssl.SSLException; +import org.cacert.gigi.testUtils.ManagedTest; import org.junit.Test; -public class TestSSL { +public class TestSSL extends ManagedTest { private ByteBuffer in; private ByteBuffer inC; private ByteBuffer outC; @@ -28,8 +29,9 @@ public class TestSSL { throws NoSuchAlgorithmException, IOException { SSLContext sc = SSLContext.getDefault(); SSLEngine se = sc.createSSLEngine(); - SocketChannel s = SocketChannel.open(new InetSocketAddress("localhost", - 443)); + String[] serverParts = getServerName().split(":", 2); + SocketChannel s = SocketChannel.open(new InetSocketAddress( + serverParts[0], Integer.parseInt(serverParts[1]))); in = ByteBuffer.allocate(se.getSession().getApplicationBufferSize()); inC = ByteBuffer.allocate(se.getSession().getPacketBufferSize());