sslkeylog: add support to enable or disable SSL key log before node connection - #3556
Open
VaibhavTekale1 wants to merge 38 commits into
Open
VaibhavTekale1 wants to merge 38 commits into
VaibhavTekale1 wants to merge 38 commits into
Conversation
Add a generic DTLS wrapper to lws that is able to work using any of the supported tls libraries as the backed: openssl (and variants), mbedtls, gnutls, schannel Note that schannel is not able to work with webrtc due to schannel api's own limitations. You must use openssl or mbedtls for windows if you want to use dtls for webrtc.
Having added a member to lws_plugin_protocol, it's a good time to change the old struct initializer format to C9, since we'll have to visit them all anyway. Also modernize the event lib struct while we're at it.
lws-team
force-pushed
the
main
branch
26 times, most recently
from
May 20, 2026 06:46
14e2c0b to
8e57b3d
Compare
|
| goto failed; | ||
| } | ||
|
|
||
| n = sprintf(buf, "%d", ac->len); |
| mkdir(vhd->storage_path, 0777); | ||
| lwsl_user("%s: PUT targeting filepath: %s\n", __func__, path); | ||
|
|
||
| if (mkdir(vhd->storage_path, 0777) < 0 && errno != EEXIST) { |
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.




Summary
Added a context-level runtime API to control TLS key logging without requiring a live wsi.
This addresses the gap where key logging could not be toggled cleanly at runtime at context scope.
The API supports both enable and disable behavior through one entry point.
Changes
Implemented
ws_ctx_set_reset_keylog_file(context, ssl_key_file_path) in libwebsockets core logic.Updated BACnet integration to call this API from context path in lwscontext.c when wsi is not available.
Kept existing wsi-based flow unchanged, and used context-based fallback only when needed.
Public API Details
API name:
lws_ctx_set_reset_keylog_fileSignature: takes struct lws_context *context and const char *ssl_key_file_path
Behavior:
Non-NULL path: enables/updates key logging file at context level
NULL path: clears/disables key logging at context level
Intended usage: runtime key logging control for client/server flows that only have context handle.
Advantages:
Runtime enable/disable support at context level.
Single generic API for set and reset reduces integration complexity.
Works even before/without per-connection wsi availability.
Improves operability for debugging TLS traffic in long-running systems without restart.