-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUST-226 Support tlsCertificateKeyFilePassword #1256
RUST-226 Support tlsCertificateKeyFilePassword #1256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with additional suggestions applied.
Testing with the drivers-evergreen-tools certificates initially got this error:
Error { kind: InvalidTlsConfig { message: "Invalid encrypted private key: PKCS#8 ASN.1 error: unknown/unsupported OID: 1.2.840.113549.3.7 at DER byte 66" }, labels: {}, wire_version: None, source: None }
OID 1.2.840.113549.3.7 refers to a DES algorithm. The error was fixed by adding features 3des
, des-insecure
, and sha1-insecure
:
pkcs8 = { version = "0.10.2", features = [
"encryption",
"pkcs5",
"3des",
"des-insecure",
"sha1-insecure",
] }
However, https://docs.rs/pkcs8/latest/pkcs8/ notes:
DES support (gated behind the des-insecure feature) is implemented to allow for decryption of legacy PKCS#8 files only.
I expect that the drivers-evergreen-tools certificate using outdated algorithms. I suggest keeping those feature flags out for now (as is done in current changes).
With those feature flags added, I was able to connect (both with openssl-tls
and without) with this test.
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Yup, that makes sense. Downstream users can enable those features if they happen to be using keys with those algorithms.
Thank you! |
Update: I've put this behind an optional feature flag, since my expectation is that the very large majority of users will never want this and that avoids pulling in extra dependencies for them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM. There's a parsing test in src/client/options/test.rs
that can be unskipped as part of this as well. Would it be feasible to add something like Kevin's test to CI? I'd like to avoid inadvertently breaking this in the future
Unskipped the test; I'd like to leave the CI integration test for a follow-up PR for expediency and to make merging into the backport branch simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to leave the CI integration test for a follow-up PR for expediency and to make merging into the backport branch simpler.
Makes sense, filed RUST-2112
RUST-226
This will (probably; I'm not sure how to test it) allow using
tlsCertificateKeyFilePassword
or the corresponding in-code option field. Should work for bothrustls-tls
andopenssl-tls
.