Skip to content

Commit

Permalink
Merge pull request #25234 from sberyozkin/oidc_keystore_provider_prop
Browse files Browse the repository at this point in the history
Add OIDC TLS key store provider property
  • Loading branch information
sberyozkin authored Apr 28, 2022
2 parents 2929df5 + d6edfd5 commit ae93b58
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ public enum Verification {
@ConfigItem
public Optional<String> keyStoreFileType = Optional.empty();

/**
* An optional parameter to specify a provider of the key store file. If not given, the provider is automatically
* detected
* based on the key store file type.
*/
@ConfigItem
public Optional<String> keyStoreProvider;

/**
* A parameter to specify the password of the key store file. If not given, the default ("password") is used.
*/
Expand Down Expand Up @@ -484,6 +492,14 @@ public enum Verification {
@ConfigItem
public Optional<String> trustStoreFileType = Optional.empty();

/**
* An optional parameter to specify a provider of the trust store file. If not given, the provider is automatically
* detected
* based on the trust store file type.
*/
@ConfigItem
public Optional<String> trustStoreProvider;

public Optional<Verification> getVerification() {
return verification;
}
Expand Down Expand Up @@ -516,6 +532,22 @@ public void setTrustStoreCertAlias(String trustStoreCertAlias) {
this.trustStoreCertAlias = Optional.of(trustStoreCertAlias);
}

public Optional<String> getKeyStoreProvider() {
return keyStoreProvider;
}

public void setKeyStoreProvider(String keyStoreProvider) {
this.keyStoreProvider = Optional.of(keyStoreProvider);
}

public Optional<String> getTrustStoreProvider() {
return trustStoreProvider;
}

public void setTrustStoreProvider(String trustStoreProvider) {
this.trustStoreProvider = Optional.of(trustStoreProvider);
}

}

@ConfigGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public static void setHttpClientOptions(OidcCommonConfig oidcConfig, TlsConfig t
.setPassword(oidcConfig.tls.getTrustStorePassword().orElse("password"))
.setAlias(oidcConfig.tls.getTrustStoreCertAlias().orElse(null))
.setValue(io.vertx.core.buffer.Buffer.buffer(trustStoreData))
.setType(getStoreType(oidcConfig.tls.trustStoreFileType, oidcConfig.tls.trustStoreFile.get()));
.setType(getStoreType(oidcConfig.tls.trustStoreFileType, oidcConfig.tls.trustStoreFile.get()))
.setProvider(oidcConfig.tls.trustStoreProvider.orElse(null));
options.setTrustOptions(trustStoreOptions);
if (Verification.CERTIFICATE_VALIDATION == oidcConfig.tls.verification.orElse(Verification.REQUIRED)) {
options.setVerifyHost(false);
Expand All @@ -150,7 +151,8 @@ public static void setHttpClientOptions(OidcCommonConfig oidcConfig, TlsConfig t
.setAlias(oidcConfig.tls.keyStoreKeyAlias.orElse(null))
.setAliasPassword(oidcConfig.tls.keyStoreKeyPassword.orElse(null))
.setValue(io.vertx.core.buffer.Buffer.buffer(keyStoreData))
.setType(getStoreType(oidcConfig.tls.keyStoreFileType, oidcConfig.tls.keyStoreFile.get()));
.setType(getStoreType(oidcConfig.tls.keyStoreFileType, oidcConfig.tls.keyStoreFile.get()))
.setProvider(oidcConfig.tls.keyStoreProvider.orElse(null));
options.setKeyCertOptions(keyStoreOptions);

} catch (IOException ex) {
Expand Down

0 comments on commit ae93b58

Please sign in to comment.