Repository navigation
feat(tls): support application-selected rustls crypto providers - #456
Draft
juanjosalco wants to merge 2 commits into
Draft
juanjosalco wants to merge 2 commits into
juanjosalco wants to merge 2 commits into
Conversation
Add a provider-neutral Rustls feature while preserving the existing AWS-LC fallback. Keep TLS configuration gates consistent and cover isolated provider selection, dependency graphs, and verified TLS handshakes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Author
|
I’ve linked an issue describing the use case and proposed behavior. This keeps the existing |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Follow-up to #446: honoring a process-installed
CryptoProviderdoes not let applications avoid compiling AWS-LC whiletokio-rustlsenables its defaults and Tiberius has an unconditional AWS-LC fallback.Change
rustls-no-provider, enabling the existing Rustls implementation without a crypto backend.tokio-rustlsdefaults, explicitly retain logging/TLS 1.2, and make the existingrustlsfeature forward AWS-LC. Its installed-provider preference and connection-local fallback remain unchanged.CryptoProvider; missing providers produce an actionableError::Tls, not a panic or backend inference.Consumer configuration:
default-features = false, features = ["tds73", "rustls-no-provider"]; install the application's provider once beforeClient::connect. Usetds80instead oftds73for strict encryption.Cargo features are additive.
rustls-webpki-rootsstill impliesrustlsand AWS-LC for compatibility; provider-neutral users can use native roots and additional CA files/bundles instead. No provider-neutral bundled-root feature is introduced here.Regression coverage
The isolated consumer under
tests/rustls-providerhas its own workspace, so root dev-dependencies cannot mask a backend leak. Separate integration binaries isolate process-global provider state.Off) TLS paths, even when a provider backend was compiled but not installed.rustlsworks without installation and does not mutate the process default.cargo check --no-default-features --features rustls-no-provider,tds80 --libimmediately after its unchangedcargo check --features allstep. The adjacent comment distinguishes the native-TLSallfeature, provider-neutral MSRV coverage, and stable Rustls backend tests.Validation
The following implementation results were recorded at
8bbd59fe9e01a74b6f790756077c8b0e09605c68; they were not rerun for the CI-only follow-up below. All listed configurations passed locally on x86_64:Windows library Rustls tests include
winauthbecause existing Windows authentication unit tests need it; the isolated provider consumers do not. SymCrypt usedrustls-symcrypt 0.2.3and a session-local SymCrypt 103.13.0 SDK/runtime. Linux OpenSSL usedrustls-openssl 0.4.2with system OpenSSL 3.5.1.Normal dependency graph results:
cargo fmt --check(both workspaces),git diff --check, advisory Clippy, Rustdoc, and no-TLS / provider-neutral TDS feature compilation also passed. Existing Clippy/Rustdoc warnings remain outside this patch.No live database was required. This is not a full platform matrix: macOS, ARM, and the separate vendored-OpenSSL TLS backend were not exercised.
Rust 1.88 CI follow-up
CI-only commit:
773dca9282e68dd84dac44481bf5a2bcc844512e. Only.github/workflows/test.ymlchanged; no library, dependency-manifest, release-version, or MSRV changes.Exact command, run on Windows x86_64 (
x86_64-pc-windows-msvc) usingrustc 1.88.0 (6b00bc388 2025-06-23)andcargo 1.88.0 (873a06493 2025-05-10):uuid 1.27.0, which requires Rust 1.89.0. This comes from the existinguuid = "1.0"dependency, not the provider-neutral changes.cargo +1.88.0 update -p uuid --precise 1.26.0changed only the ignored local lockfile, the exact check above completed successfully with six existing Windows dead-code warnings. The original ignored lockfile was restored afterward; no dependency pin was committed.This establishes that the provider-neutral code compiles on Rust 1.88 with compatible dependencies, not that an unconstrained fresh MSRV build is green. The UUID resolution issue remains unresolved and needs a separately agreed dependency/resolution policy; this surgical CI follow-up does not hide it or raise the MSRV.
Both workspace
cargo fmt --checkcommands andgit diff --checkpassed. PyYAML parsed the workflow and a structural comparison confirmed that the sole behavioral change is the requested step, immediately after the existing MSRV check, with toolchain 1.88 unchanged. No full feature matrix or database tests were rerun for this CI-only change.At the pushed follow-up head, Cargo tests, PR Code Security, and Security audit report
action_requiredwith zero check runs, consistent with pending maintainer approval for fork workflows. This is not a test failure or successful CI execution.Implementation commit:
8bbd59fe9e01a74b6f790756077c8b0e09605c68, based on upstream main35605c90adb38cc107d35c3432fd2643d9d6e1e6. Current head adds the CI-only follow-up773dca9282e68dd84dac44481bf5a2bcc844512e.Closes #457