use of com.palantir.conjure.java.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();
SslConfiguration sslConfiguration = timeLockClientConfig.serversList().sslConfiguration().get();
assertSslConfigDeserializedCorrectly(sslConfiguration);
}
use of com.palantir.conjure.java.api.config.ssl.SslConfiguration in project conjure-java-runtime by palantir.
the class TestBase method createTestConfig.
protected final ClientConfiguration createTestConfig(String... uri) {
SslConfiguration sslConfig = SslConfiguration.of(Paths.get("src/test/resources/trustStore.jks"));
ClientConfiguration config = ClientConfigurations.of(ImmutableList.copyOf(uri), SslSocketFactories.createSslSocketFactory(sslConfig), SslSocketFactories.createX509TrustManager(sslConfig));
return ClientConfiguration.builder().from(config).userAgent(AGENT).build();
}
use of com.palantir.conjure.java.api.config.ssl.SslConfiguration in project conjure-java-runtime by palantir.
the class DropwizardSslClientAuthTests method testConnectionWorksWithClientCertsWithIntermediateCa.
@Test
public void testConnectionWorksWithClientCertsWithIntermediateCa() {
SslConfiguration sslConfig = SslConfiguration.builder().trustStorePath(TestConstants.CA_TRUST_STORE_PATH).keyStorePath(TestConstants.CHILD_KEY_CERT_CHAIN_PEM_PATH).keyStorePassword("").keyStoreType(SslConfiguration.StoreType.PEM).build();
TestEchoService service = createTestService(sslConfig);
assertThat(service.echo("foo")).isEqualTo("foo");
}
use of com.palantir.conjure.java.api.config.ssl.SslConfiguration in project conjure-java-runtime by palantir.
the class DropwizardSslClientAuthTests method testConnectionFailsWithoutClientCerts.
@Test
public void testConnectionFailsWithoutClientCerts() {
SslConfiguration sslConfig = SslConfiguration.of(TestConstants.CA_TRUST_STORE_PATH);
TestEchoService service = createTestService(sslConfig);
assertThatThrownBy(() -> service.echo("foo")).isInstanceOf(RetryableException.class);
}
use of com.palantir.conjure.java.api.config.ssl.SslConfiguration in project conjure-java-runtime by palantir.
the class DropwizardSslClientAuthTests method testConnectionWorksWithClientCerts.
@Test
public void testConnectionWorksWithClientCerts() {
SslConfiguration sslConfig = SslConfiguration.of(TestConstants.CA_TRUST_STORE_PATH, TestConstants.CLIENT_KEY_STORE_JKS_PATH, TestConstants.CLIENT_KEY_STORE_JKS_PASSWORD);
TestEchoService service = createTestService(sslConfig);
assertThat(service.echo("foo")).isEqualTo("foo");
}
Aggregations