Skip to content

Fix client ca cert Native Leak when startUp and reload#44

Closed
Chenjp wants to merge 1 commit intoapache:mainfrom
Chenjp:sslcontext_release_cert
Closed

Fix client ca cert Native Leak when startUp and reload#44
Chenjp wants to merge 1 commit intoapache:mainfrom
Chenjp:sslcontext_release_cert

Conversation

@Chenjp
Copy link
Contributor

@Chenjp Chenjp commented Mar 12, 2026

Ensure the allocated client ca cert memory is properly reclaimed, which is dangerous if a tomcat-based multi-tenants gateway service with dynamic SNI feature or tenant cert configuration hot reload feature enabled. The native heap ignore -Xmx settings, is invisible to most standard java monitoring tools until the ENTIRE OS RUNS OOM.

Deterministic native mem leak is realistic, per observation in PoC, via /manager/text/sslReload x 10000 times → 12.6MB

Originally, an X509 certificate object is allocated via d2i_X509 but is never released after being added to the SSL context.

Ensure the allocated memory is properly reclaimed.
Originally, an X509 certificate object is allocated via d2i_X509 but is never released after being added to the SSL context.
@markt-asf
Copy link
Contributor

Thanks. Applied manually so I could add a change log entry,

@markt-asf markt-asf closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants