I'm having an issue with ssl session caching. To test if server configuration is OK, I use the following command:
echo | openssl s_client -connect <server.com>:443 -reconnect 2>/dev/null| egrep -iw "New|Reused|Session-ID:"
It outputs "New" for the first request, and then "Reused". So server config seems ok.
When I look at apache2 access.log I can see that for some clients, it is working as expected. The best way I found so far to diagnose ssl session resumption is to look at the sent byte count (%O).
Example of a working client log :
IP - - [D:10:36:59] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 5142 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:00] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 482 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:03] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 635 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:04] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 482 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:06] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 482 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:09] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 635 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:11] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 482 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:13] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 635 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:15] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 482 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:17] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 482 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
IP - - [D:10:37:19] "GET /rest/instant_message/TEST HTTP/1.1" 200 13 635 "-" "Dalvik/2.1.0 (Linux; U; Android 8.1.0; iot800n Build/OPM6.171019.030.K1)"
In the log above, you can see that the first request response is 5142 bytes (13 content length). And all subsequent requests responses are 482 or 635 bytes (same content length).
However for some clients, all requests responses are ~5kb. As shown in the example log bellow:
IP - - [D:10:30:45] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:31:00] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:31:15] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:31:30] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:31:45] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:32:00] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:32:15] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:32:30] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
IP - - [D:10:32:45] "GET /rest/instant_message/BOM1 HTTP/1.1" 200 419 5549 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-T395 Build/PPR1.180610.011)"
Sometimes, the same client (same ip) will sometimes use session resumption, then stop using it, then reuse it, etc.
All clients are the same android tablets (SMT395) running the same application using the Volley library for http requests. They are connected to internet with a SIM Card.
Server conf is :
SSLSessionCache shmcb:${APACHE_RUN_DIR}/ssl_scache(512000)
SSLSessionCacheTimeout 300
What could be the cause of the non-resumption of the https session ? What tools can I use to debug the https session ?