[feature](brpc) Support TLS certificate hot reload - #67230
Open
Yukang-Lian wants to merge 1 commit into
Open
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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.
Problem
The vendored BRPC 1.4 TLS server cannot reload its default certificate and private key after startup. Certificate rotation therefore requires rebuilding the server-side TLS context, and encrypted private keys also need to be propagated into BRPC.
Changes
SSL_CTXbefore publishing it.SSL_newandSSL_set_SSL_CTXtake an OpenSSL reference before the old owner reference is released.The final
brpc-zzzz-*patch intentionally follows the historical hot-reload backport in the existingbrpc-*patch order. It replaces the original delayed-free/atomic-cast approach with the reference-counted, locked handoff described above.Validation
brpc-*patches, in the same order used bydownload-thirdparty.sh, onto a fresh BRPC 1.4.0 tree: no rejects.brpc-staticandbrpc-sharedwith OpenSSL 1.1.1s.SSLTest.ssl_reload: passed.SSLTest.hot_reload_default_certificate_during_handshakes: passed; it performs 20 certificate swaps while a background thread repeatedly creates short TLS connections and executes RPCs.Known limits
st_mtime.ServerOptions.