Skip to content
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

Load cert from file system in key vault #21947

Merged
merged 68 commits into from
Jun 15, 2021

Conversation

zhichengliu12581
Copy link
Contributor

related issue: #21611
we need support load cert from file system(A configurable path).

@chenrujun
Copy link

@chenrujun
Copy link

/azp run java - keyvault - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chenrujun
Copy link

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

customCertificates = new FileSystemCertificates(customPath);
keyVaultCertificates = new KeyVaultCertificates(refreshInterval, keyVaultClient, this);
classpathCertificates = new ClasspathCertificates();
allCertificates = Arrays.asList(jreCertificates, wellKnowCertificates, customCertificates, keyVaultCertificates, classpathCertificates);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add unit test for the priority? For example:

  1. wellKnowCertificates and customCertificates has same alias, the first one will be used.
  2. Same to customCertificates and classpathCertificates

Copy link

@chenrujun chenrujun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please create another PR to update changelog and readme.

import java.security.cert.CertificateException;
import java.util.Arrays;
import java.util.List;

public class PropertyConvertorUtils {

public static void putEnvironmentPropertyToSystemProperty(List<String> key) {
public static void putEnvironmentPropertyToSystemPropertyForKeyVaultJca(List<String> key) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Delete parameter of this method, because it's always equal to SYSTEM_PROPERTIES.

@chenrujun chenrujun merged commit 04fbb4f into Azure:master Jun 15, 2021
@chenrujun
Copy link

pls ping me again before merge this PR

Hi, @stliu , sorry that I forgot this. Please review this PR again. And @lzc-1997-abel will create another PR to :

  1. Update changelog and readme.
  2. Update code according to your comments.

@zhichengliu12581 zhichengliu12581 deleted the add-support-fileSystem2 branch August 24, 2021 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues azure-spring-keyvault Spring keyvault related issues. KeyVault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support end to end TLS: Load cert from file system.
4 participants