Repository navigation
Example client: larger static memory pool with the compat layer - #12256
Merged
Merged
Conversation
With OPENSSL_EXTRA the compatibility layer copies each peer certificate into a WOLFSSL_X509, where every RDN and subjectAltName is its own small allocation. A public server's leaf can carry dozens of names, which drains the smallest bucket of the 320000 byte WOLFSSL_STATIC_MEMORY pool and the handshake then runs the pool dry. Scale the whole pool to 1280000 bytes for that case, in BSS since the standalone client calls this function once.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The compatibility-layer memory-pool update has no active review issues.
No open issues 🎉
What changed in this PR
Increases the example client’s static memory capacity for compatibility-layer builds to accommodate allocation-heavy peer certificates.
Changes:
- Uses a 1,280,000-byte pool for standalone builds with
OPENSSL_EXTRAorOPENSSL_EXTRA_X509_SMALL. - Places the larger pool in static storage to avoid increasing stack usage, while preserving existing sizing for other builds.
- Updates the cleanup comment to reflect that the pool is not always stack-allocated.
| File | Description |
|---|---|
examples/client/client.c |
Adds the larger compatibility-layer memory pool and clarifies its storage and cleanup comments. |
Review effort: Balanced
|
philljj
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With OPENSSL_EXTRA the compatibility layer copies each peer certificate into a WOLFSSL_X509, where every RDN and subjectAltName is its own small allocation. A public server's leaf can carry dozens of names, which drains the smallest bucket of the 320000 byte WOLFSSL_STATIC_MEMORY pool and the handshake then runs the pool dry. Scale the whole pool to 1280000 bytes for that case, in BSS since the standalone client calls this function once.
Testing
./configure --enable-staticmemory --enable-opensslextra
make
./examples/client/client -h google.com -p 443 -g -d