我在我的一个应用程序中使用 spring 集成来与银行进行通信。在重负载时,我们收到错误“org.springframework.messaging.MessagingException:SSL 握手时间过长”。银行要求我们将超时设置为 90 秒。在查看 TcpNioSSLConnection 类的代码时,我发现 30 秒是硬编码的。
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;
}
如果有任何方法可以增加 ssl 握手超时,请建议我
下面是我的spring集成连接工厂配置
<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"/>
谢谢,罗希特