use of com.palantir.remoting.api.config.ssl.SslConfiguration in project atlasdb by palantir.
the class TimeLockTestUtils method createTransactionManager.
static SerializableTransactionManager createTransactionManager(TestableTimelockCluster cluster) {
List<String> serverUris = cluster.servers().stream().map(server -> server.serverHolder().getTimelockUri()).collect(Collectors.toList());
AtlasDbConfig config = ImmutableAtlasDbConfig.builder().namespace("test").keyValueService(new InMemoryAtlasDbConfig()).timelock(ImmutableTimeLockClientConfig.builder().serversList(ImmutableServerListConfig.builder().servers(serverUris).sslConfiguration(SslConfiguration.of(Paths.get("var/security/trustStore.jks"))).build()).build()).build();
return TransactionManagers.builder().config(config).userAgent("test").globalMetricsRegistry(new MetricRegistry()).globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()).build().serializable();
}
use of com.palantir.remoting.api.config.ssl.SslConfiguration in project atlasdb by palantir.
the class AtlasDbConfigDeserializationTest method assertTimeLockConfigDeserializedCorrectly.
private void assertTimeLockConfigDeserializedCorrectly(TimeLockClientConfig timeLockClientConfig) {
assertThat(timeLockClientConfig.getClientOrThrow()).isEqualTo("brian");
assertThat(timeLockClientConfig.serversList().servers()).containsExactlyInAnyOrder("timelock1:8080", "timelock2:8080", "timelock3:8080");
assertThat(timeLockClientConfig.serversList().sslConfiguration().isPresent()).isTrue();
SslConfiguration sslConfiguration = timeLockClientConfig.serversList().sslConfiguration().get();
assertSslConfigDeserializedCorrectly(sslConfiguration);
}
use of com.palantir.remoting.api.config.ssl.SslConfiguration in project atlasdb by palantir.
the class AtlasDbCommandUtilsTest method canSerializeAndDeserializeAtlasDbConfig.
@Test
public void canSerializeAndDeserializeAtlasDbConfig() throws IOException {
SslConfiguration ssl = SslConfiguration.of(new File("var/security/truststore.jks").toPath(), new File("var/security/keystore.jks").toPath(), "keystorePassword");
@SuppressWarnings("deprecation") AtlasDbConfig bigConfig = ImmutableAtlasDbConfig.builder().leader(ImmutableLeaderConfig.builder().quorumSize(1).addLeaders(LOCAL_SERVER_NAME).localServer(LOCAL_SERVER_NAME).sslConfiguration(ssl).learnerLogDir(new File("var/data/paxos/learner").getAbsoluteFile()).acceptorLogDir(new File("var/data/paxos/acceptor").getAbsoluteFile()).build()).keyValueService(ImmutableCassandraKeyValueServiceConfig.builder().keyspace("test").replicationFactor(3).servers(ImmutableSet.of(new InetSocketAddress("host1", 9160), new InetSocketAddress("host2", 9160), new InetSocketAddress("host3", 9160))).ssl(true).sslConfiguration(ssl).build()).build();
String configAsString = AtlasDbCommandUtils.serialiseConfiguration(bigConfig);
AtlasDbConfig deserializedConfig = AtlasDbConfigs.loadFromString(configAsString, "", AtlasDbConfig.class);
assertThat(bigConfig).isEqualTo(deserializedConfig);
}
Aggregations