2016-12-13 55 views
0

我在我的一个应用程序中使用弹簧集成与银行进行通信。在重载时,我们收到错误“org.springframework.messaging.MessagingException:SSL握手花费的时间过长”。银行要求我们将超时设置为90秒。 查看TcpNioSSLConnection类的代码时,我发现30秒是硬编码的。在弹簧集成中没有选项定义SSL握手超时

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握手超时

下面

是我的春天一体化连接工厂配置

<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"/> 

感谢, 罗希特

回答

0

目前还没有方式来配置超时;我已打开JIRA Issue

您可以尝试设置use-niofalse;除非长时间打开很多套接字,否则通常不需要。

+0

谢谢你的回复加里。我会检查一下 –

+0

谢谢加里, –