diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java index 8a2f9df5bd..1d7480d59e 100644 --- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java +++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java @@ -13,6 +13,7 @@ * * Copyright 2010 Sun Microsystems, Inc. * Portions Copyright 2011-2016 ForgeRock AS. + * Portions Copyright 2019-2024 3A Systems, LLC. */ package org.forgerock.opendj.grizzly; @@ -830,7 +831,7 @@ void startTLS(final SSLContext sslContext, final List protocols, final L SSLEngineConfigurator serverSslEngineConfigurator = buildServerSSLEngineConfigurator(sslContext); final SSLFilter sslFilter = new SSLFilter(serverSslEngineConfigurator, sslEngineConfigurator); - sslFilter.setHandshakeTimeout(getLongProperty("org.forgerock.opendj.grizzly.handshakeTimeout", sslFilter.getHandshakeTimeout(TimeUnit.MILLISECONDS)), TimeUnit.MILLISECONDS); + sslFilter.setHandshakeTimeout(getLongProperty("org.forgerock.opendj.grizzly.handshakeTimeout", 10000), TimeUnit.MILLISECONDS); installFilter(sslFilter); sslFilter.handshake(connection, completionHandler); } diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java index 8aea37dc7a..0af9bc6a3a 100644 --- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java +++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java @@ -13,6 +13,7 @@ * * Copyright 2010 Sun Microsystems, Inc. * Portions Copyright 2012-2016 ForgeRock AS. + * Portions Copyright 2017-2024 3A Systems, LLC. */ package org.forgerock.opendj.grizzly; @@ -399,7 +400,7 @@ public boolean enableTLS(final SSLEngine sslEngine, final boolean startTls) { } SSLFilter sslFilter = new SSLFilter(); - sslFilter.setHandshakeTimeout(getLongProperty("org.forgerock.opendj.grizzly.handshakeTimeout", sslFilter.getHandshakeTimeout(TimeUnit.MILLISECONDS)), TimeUnit.MILLISECONDS); + sslFilter.setHandshakeTimeout(getLongProperty("org.forgerock.opendj.grizzly.handshakeTimeout", 10000), TimeUnit.MILLISECONDS); installFilter(startTls ? new StartTLSFilter(sslFilter) : sslFilter); return true; } diff --git a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java index d55d553430..bf7c0db246 100644 --- a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java +++ b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/ConnectionFactoryTestCase.java @@ -13,6 +13,7 @@ * * Copyright 2010 Sun Microsystems, Inc. * Portions Copyright 2011-2016 ForgeRock AS. + * Portions Copyright 2019-2024 3A Systems, LLC. */ package org.forgerock.opendj.grizzly; @@ -565,12 +566,12 @@ public Void answer(InvocationOnMock invocation) throws Throwable { assertThat(context.isClosed()).isFalse(); if (config.sendDisconnectNotification) { context.disconnect(ResultCode.BUSY, "busy"); - for(int i=1;i<10 && !context.isClosed() ;i++) { - Thread.sleep(100); - } } else { context.disconnect(); } + for(int i=1;i<100 && !context.isClosed() ;i++) { + Thread.sleep(100); + } assertThat(context.isClosed()).isTrue(); } // Block until remote close is signalled.