I have an Undertow container for a Spring Boot application (Java 11) which is started using https. The application is communicating with a IOS (Swift) and Android phone. I noticed that after not using the phone for a while ( 1 minute), the first request takes more time because the SSL handshake is performed.
I am wondering if there would be an option to cache/ invalidate the https session so that the first request after a longer period of time does not do the hanshake again.
Based on Robert's comment I will elaborate an answer.
I used
-Djavax.net.debug=ssl:handshake:verbose
to help me track the ssl handshakes. Then, after seeing logs in the console I found out the classes responsible for the implementation of the TLS. Using debug I found this property for undertow. I think that for Tomcat should be similar.
server.undertow.no-request-timeout
which I set in my application.properties to -1
No changes were required on the clients (phones: IOS and Android).