mirror of
https://github.com/keycloak/keycloak.git
synced 2026-05-08 08:01:18 -05:00
Enable the TLS based JGroups encryption by default and update the docs
Closes #37696 Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
committed by
GitHub
parent
a0de3c26d7
commit
bc7ec1208e
+4
-2
@@ -84,7 +84,8 @@ public class JGroupsCertificateHolder {
|
||||
}
|
||||
|
||||
private static X509ExtendedKeyManager createKeyManager(JGroupsCertificate newCertificate) throws GeneralSecurityException, IOException {
|
||||
var ks = CryptoIntegration.getProvider().getKeyStore(KeystoreUtil.KeystoreFormat.JKS);
|
||||
KeystoreUtil.KeystoreFormat keystoreFormat = CryptoIntegration.getProvider().getSupportedKeyStoreTypes().findFirst().orElseThrow(() -> new RuntimeException("No supported keystore types found"));
|
||||
var ks = CryptoIntegration.getProvider().getKeyStore(keystoreFormat);
|
||||
ks.load(null, null);
|
||||
ks.setKeyEntry(newCertificate.getAlias(), newCertificate.getPrivateKey(), KEY_PASSWORD, new java.security.cert.Certificate[]{newCertificate.getCertificate()});
|
||||
var kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
|
||||
@@ -98,7 +99,8 @@ public class JGroupsCertificateHolder {
|
||||
}
|
||||
|
||||
private static X509ExtendedTrustManager createTrustManager(JGroupsCertificate oldCertificate, JGroupsCertificate newCertificate) throws GeneralSecurityException, IOException {
|
||||
var ks = CryptoIntegration.getProvider().getKeyStore(KeystoreUtil.KeystoreFormat.JKS);
|
||||
KeystoreUtil.KeystoreFormat keystoreFormat = CryptoIntegration.getProvider().getSupportedKeyStoreTypes().findFirst().orElseThrow(() -> new RuntimeException("No supported keystore types found"));
|
||||
var ks = CryptoIntegration.getProvider().getKeyStore(keystoreFormat);
|
||||
ks.load(null, null);
|
||||
if (oldCertificate != null) {
|
||||
addCertificateEntry(ks, oldCertificate);
|
||||
|
||||
Reference in New Issue
Block a user