diff options
Diffstat (limited to 'x-net/src')
-rw-r--r-- | x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp | 4 | ||||
-rw-r--r-- | x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp index b474905..6489370 100644 --- a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp +++ b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp @@ -1022,6 +1022,10 @@ static void org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl_init(JNIEnv* * and undesirable.) */ mode |= SSL_MODE_ENABLE_PARTIAL_WRITE; + mode |= SSL_MODE_SMALL_BUFFERS; /* lazily allocate record buffers; usually saves + * 44k over the default */ + mode |= SSL_MODE_HANDSHAKE_CUTTHROUGH; /* enable sending of client data as soon as + * ClientCCS and ClientFinished are sent */ SSL_CTX_set_mode(ssl_ctx, mode); if (privatekey != NULL) { diff --git a/x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java b/x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java index 46ec1d2..6eca114 100644 --- a/x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java +++ b/x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java @@ -34,6 +34,7 @@ import tests.support.Support_PortManager; import java.io.ByteArrayInputStream; import java.io.InputStream; +import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.security.KeyStore; @@ -699,14 +700,15 @@ public class SSLSessionTest extends TestCase { boolean notFinished = true; SSLSession clientSession = null; SSLContext clientSslContext = null; + String testData = "PING"; private String PASSWORD = "android"; String cipherSuite = (useBKS ? cipherSuiteBKS : cipherSuiteJKS); /** - * Implements a test SSL socket server. It wait for a connection on a given - * port, requests client authentication (if specified), and read 256 bytes + * Implements a test SSL socket server. It waits for a connection on a given + * port, requests client authentication (if specified), and reads * from the socket. */ class TestServer implements Runnable { @@ -789,7 +791,7 @@ public class SSLSessionTest extends TestCase { /** * Implements a test SSL socket client. It open a connection to localhost on - * a given port and writes 256 bytes to the socket. + * a given port and writes to the socket. */ class TestClient implements Runnable { @@ -822,6 +824,9 @@ public class SSLSessionTest extends TestCase { SSLSocket socket = (SSLSocket)clientSslContext.getSocketFactory().createSocket(); socket.connect(new InetSocketAddress(port)); + OutputStream ostream = socket.getOutputStream(); + ostream.write(testData.getBytes()); + ostream.flush(); clientSession = socket.getSession(); while (notFinished) { |