internal(tlssettings tlsconfig): rework TlsSettings to carry PEM based objects #23146
+60
−65
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
Modify TlsSettings to carry PEM files instead of PKCS12 for FIPS compatibility. Internal only, no breaking changes.
TlsSettings used a PKCS12 archive to store the TLS identity information. PKCS12 is not Federal Information Processing Standard (FIPS) compliant, and there is significant interest to use vector in such environments. Converting to and from PKCS12 does not work (PKCS12KDF is not compliant) and is best avoided. TlsSettings encapsulates this detail very well, and this change is thus internal to TlsSettings and it's initializer TlsConfig.
This change makes PEM based certs & keys the format stored in TlsSettings. For reverse compatibility, when a PKCS12 (DER) archive is presented in the configuration, the code will extract the components into PEM at load time. This conversion is not FIPS compliant and should be avoided there. In pratice, most use cases do not use FIPS, so this is perfectly fine to use.
Key changes:
Change Type
Is this a breaking change?
How did you test this PR?
Executed vector tests:
cargo test --all
./scripts/check_changelog_fragments.sh
Tested on a regular non-fips machine, and on a FIPS enabled kernel where we compiled vector to dynamically link to the system provided OpenSSL. Only the 'fips' and 'base' providers were configured to be available:
RUSTFLAGS="-C prefer-dynamic" OPENSSL_NO_VENDOR=1 OPENSSL_STATIC=0
cargo build -j8 --release --target x86_64-unknown-linux-gnu
--no-default-features --features target-x86_64-unknown-linux-gnu
Does this PR include user facing changes?
Notes
See issue: