Use keytool to rewrite truststore with AES encryption#510
Merged
maltesander merged 1 commit intomainfrom Oct 3, 2023
Merged
Conversation
Member
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.
Description
NiFi 1.18 fails to start, because it can't read the contents of the PKCS12 truststore. Since #505, secret-operator handles the creation of the PKCS12 key- and truststore. To create the encrypted truststore, we use the p12 crate, which creates the PKCS12 store using a legacy algorithm. Currently, we can't use the openssl crate for this, see this comment.
As a workaround, until secret-operator is able to create the PKCS12 truststore with AES-256-CBC encryption (right now the p12 crate uses RC2-40-CBC), we import the truststore using keytool (which is able to read it) and export it again. Keytool encrypts the newly created truststore using AES-256-CBC.
This is the output when trying to open the truststore generated by secret-operator using openssl:
When we add the "-legacy" flag to openssl, it works:
Opening the "converted" truststore that is created by keytool:
We didn't investigate further why NiFi 1.20 and 1.21 don't seem to have problems with the legacy algorithm, while 1.18 does.
Definition of Done Checklist