HDDS-11216. Replace HAUtils#buildCAX509List usages with other direct usages #6981
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.
To simplify the CertificateClient the HAUtils#buildCAX509List can be refactored
There are 3 methods on DefaultCertificateClient that solely exist to serve the HAUtils method, preferably these should be removed. BuildCAList is now refactored, the places where it used the certificateClient are replaced by direct calls on the certClient.
There are a couple of technical details here: before the refactor BuildCAList went to the CertificateClient for a list of CAs, and if the CertClient didn't have that value cached it reached out to SCM. Ever since the CertificateRotation has been implemented the CertClient should be able to provide the actual current certificates even without going to the SCM. Therefore it can be supplemented by direct calls to the client.
Instead of using certificates and propagating them further, it turns out the the client can return a ClientTrustManager directly which aligns better with how the CertificateClient should look in its ideal state where only key/trustmanagers are accessible.
HDDS-11216
How was this patch tested?
Clean CI run: https://github.com/Galsza/ozone/actions/runs/10041809622