Skip to content

enhancement(sources): add a runtime-swappable TLS acceptor to TCP sources#25800

Open
guilload wants to merge 2 commits into
masterfrom
guilload/tcp-source-tls-reloader
Open

enhancement(sources): add a runtime-swappable TLS acceptor to TCP sources#25800
guilload wants to merge 2 commits into
masterfrom
guilload/tcp-source-tls-reloader

Conversation

@guilload

@guilload guilload commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a runtime-swappable TLS acceptor so a TCP source can pick up rotated
certificate material without rebinding its listener.

  • TlsAcceptorReloader holds the served acceptor behind
    an Arc<ArcSwap<SslAcceptor>>; reload() rebuilds it via
    TlsSettings::acceptor() and swaps it in. WeakTlsAcceptorReloader
    (from downgrade()) is what a background reload task holds, and reports
    once the listener is gone so the task can stop.

  • MaybeTlsSettings gains reloadable_acceptor() and bind_reloadable().
    The listener now snapshots the current acceptor on each accept(), so a
    reload only affects connections accepted afterwards; in-flight connections
    keep what they negotiated. bind()/bind_with_allowlist() delegate, so
    existing behaviour is unchanged.

  • TcpSource::run and try_bind_tcp_listener take an
    Option<TlsAcceptorReloader>; all in-tree callers pass None, so no
    existing source changes behaviour.

Also bump openssl from 0.10.80 to 0.10.81 and replace the deprecated Asn1StringRef::as_utf8 with to_string.

Vector configuration

How did you test this PR?

Tested locally with OPW, Splunk TCP source, and cert reloader similarly to unit test in tls::reload.

Change Type

  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@github-actions github-actions Bot added domain: sources Anything related to the Vector's sources domain: core Anything related to core crates i.e. vector-core, core-common, etc labels Jul 10, 2026
@datadog-vectordotdev

datadog-vectordotdev Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7893659 | Docs | Give us feedback!

@guilload guilload force-pushed the guilload/tcp-source-tls-reloader branch from e27c6ef to 37628d3 Compare July 10, 2026 18:49
@guilload guilload marked this pull request as ready for review July 10, 2026 18:49
@guilload guilload requested a review from a team as a code owner July 10, 2026 18:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37628d3726

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sources/util/net/tcp/mod.rs
Comment thread lib/vector-core/src/tls/incoming.rs Outdated
@guilload guilload force-pushed the guilload/tcp-source-tls-reloader branch from 37628d3 to 02ffffb Compare July 10, 2026 19:51
@thomasqueirozb thomasqueirozb added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jul 10, 2026
@thomasqueirozb

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02ffffb0b6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sources/util/net/tcp/mod.rs
Comment thread lib/vector-core/src/tls/reload.rs

@bruceg bruceg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. TBH I did a double take at seeing the Arc-in-Arc regime of Arc<ArcSwap<T>> but it eventually made sense.

@thomasqueirozb thomasqueirozb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ci-run-regression origin/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: sources Anything related to the Vector's sources no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants