0

I am using spring integration in one of my application to communicate with bank. On heavy load we are getting error "org.springframework.messaging.MessagingException: SSL Handshaking taking too long". Bank ask us to set timeout as 90 sec. While look into the code of TcpNioSSLConnection class, I found that 30 second is hardcoded.

private HandshakeStatus waitForHandshakeData(SSLEngineResult result,
            HandshakeStatus status) thr`enter code here`ows IOException {
            try {
                if (logger.isTraceEnabled()) {
                    logger.trace("Writer waiting for handshake");
                }
            if (!TcpNioSSLConnection.this.semaphore.tryAcquire(30, TimeUnit.SECONDS)) {
                throw new MessagingException("SSL Handshaking taking too long");
            }
            if (logger.isTraceEnabled()) {
                logger.trace("Writer resuming handshake");
            }
            status = runTasksIfNeeded(result);
        }
        catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new MessagingException("Interrupted during SSL Handshaking");
        }
        return status;
    }

Please suggest me if there any way to increase ssl handshake timeout

below is my spring integration connection factory configuration

 <int-ip:tcp-connection-factory id="client"
            type="client" port="${cbs.third.party.port}"  host="${cbs.third.party.host}"
            single-use="true" using-nio="true" deserializer="javaDeserializer"
            serializer="javaSerializer" ssl-context-support="sslContextSupport" task-executor="myTaskExecutor"/>

Thanks, Rohit

1 Answer 1

0

There is currently no way to configure that timeout; I have opened a JIRA Issue.

You could try setting use-nio to false; unless you are opening a lot of sockets for long durations, it's not generally required.

1
  • Thank you Gary for your reply. I will check the same Dec 13, 2016 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.