Increase cache size to be on the safe side

This commit is contained in:
Artur Barashev 2026-01-29 20:53:26 -05:00
parent 8b0261c173
commit 6b23c05f2a
2 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ final class CompressedCertificate {
// the deflated certificate data in a memory cache statically and avoid
// compressing local certificates repeatedly for every handshake.
private static final Cache<CompCertCacheKey, byte[]> CACHE =
Cache.newSoftMemoryCache(12);
Cache.newSoftMemoryCache(92);
// Prevent instantiation of this class.
private CompressedCertProducer() {

View File

@ -91,10 +91,10 @@ public class CompressedCertMsgCache extends SSLSocketTemplate {
assertEquals(1, countSubstringOccurrences(log,
"Caching CompressedCertificate message"));
// Complete 12 handshakes, all with different certificates.
// Complete 92 handshakes, all with different certificates.
log = runAndGetLog(() -> {
try {
for (int i = 0; i < 12; i++) {
for (int i = 0; i < 92; i++) {
new CompressedCertMsgCache(
"TLSv1.3", "EC", "SHA256withECDSA").run();
}
@ -102,8 +102,8 @@ public class CompressedCertMsgCache extends SSLSocketTemplate {
}
});
// Make sure all 12 CompressedCertificate messages are cached.
assertEquals(12, countSubstringOccurrences(log,
// Make sure all 92 CompressedCertificate messages are cached.
assertEquals(92, countSubstringOccurrences(log,
"Caching CompressedCertificate message"));
// Complete 1 handshake with the same certificate as the very first one.