|
33 | 33 | import org.apache.syncope.common.keymaster.client.api.KeymasterProperties; |
34 | 34 | import org.apache.syncope.common.keymaster.client.api.ServiceOps; |
35 | 35 | import org.apache.zookeeper.ZooDefs; |
| 36 | +import org.apache.zookeeper.client.ZKClientConfig; |
| 37 | +import org.apache.zookeeper.common.X509Util; |
36 | 38 | import org.apache.zookeeper.data.ACL; |
37 | 39 | import org.apache.zookeeper.server.auth.DigestLoginModule; |
38 | 40 | import org.springframework.boot.autoconfigure.condition.ConditionOutcome; |
| 41 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
39 | 42 | import org.springframework.boot.autoconfigure.condition.SpringBootCondition; |
40 | 43 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
41 | 44 | import org.springframework.context.annotation.Bean; |
@@ -63,8 +66,20 @@ public ConditionOutcome getMatchOutcome(final ConditionContext context, final An |
63 | 66 | } |
64 | 67 |
|
65 | 68 | @Conditional(ZookeeperCondition.class) |
| 69 | + @ConditionalOnMissingBean |
66 | 70 | @Bean |
67 | | - public CuratorFramework curatorFramework(final KeymasterProperties props) throws InterruptedException { |
| 71 | + public ZKClientConfig zkClientConfig() { |
| 72 | + ZKClientConfig zkClientConfig = new ZKClientConfig(); |
| 73 | + zkClientConfig.setProperty(X509Util.FIPS_MODE_PROPERTY, "false"); |
| 74 | + return zkClientConfig; |
| 75 | + } |
| 76 | + |
| 77 | + @Conditional(ZookeeperCondition.class) |
| 78 | + @Bean |
| 79 | + public CuratorFramework curatorFramework( |
| 80 | + final ZKClientConfig zkClientConfig, |
| 81 | + final KeymasterProperties props) throws InterruptedException { |
| 82 | + |
68 | 83 | if (StringUtils.isNotBlank(props.getUsername()) && StringUtils.isNotBlank(props.getPassword())) { |
69 | 84 | javax.security.auth.login.Configuration.setConfiguration(new javax.security.auth.login.Configuration() { |
70 | 85 |
|
@@ -102,7 +117,7 @@ public List<ACL> getAclForPath(final String path) { |
102 | 117 | } |
103 | 118 | }); |
104 | 119 | } |
105 | | - CuratorFramework client = clientBuilder.build(); |
| 120 | + CuratorFramework client = clientBuilder.zkClientConfig(zkClientConfig).build(); |
106 | 121 | client.start(); |
107 | 122 | client.blockUntilConnected(3, TimeUnit.SECONDS); |
108 | 123 |
|
|
0 commit comments