Skip to content

Commit

Permalink
Switch Apache transport to Airlift PemReader
Browse files Browse the repository at this point in the history
  • Loading branch information
dain committed Jun 16, 2018
1 parent cea15b0 commit 93e2b86
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 226 deletions.
6 changes: 6 additions & 0 deletions drift-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>security</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>stats</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import io.airlift.drift.integration.scribe.drift.DriftLogEntry;
import io.airlift.drift.integration.scribe.drift.DriftResultCode;
import io.airlift.drift.integration.scribe.drift.DriftScribe;
import io.airlift.drift.transport.apache.client.PemReader;
import io.airlift.drift.transport.netty.codec.Protocol;
import io.airlift.drift.transport.netty.codec.Transport;
import io.airlift.jmx.testing.TestingJmxModule;
Expand All @@ -55,7 +54,8 @@

import static io.airlift.drift.client.guice.DriftClientBinder.driftClientBinder;
import static io.airlift.drift.client.guice.MethodInvocationFilterBinder.staticFilterBinder;
import static io.airlift.drift.transport.apache.client.PemReader.loadTrustStore;
import static io.airlift.security.pem.PemReader.loadKeyStore;
import static io.airlift.security.pem.PemReader.loadTrustStore;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
Expand Down Expand Up @@ -171,7 +171,7 @@ public static SSLContext getServerSslContext()
trustManagerFactory.init(loadTrustStore(getCertificateChainFile()));

KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(PemReader.loadKeyStore(getPrivateKeyFile(), getPrivateKeyFile(), Optional.empty()), new char[0]);
keyManagerFactory.init(loadKeyStore(getPrivateKeyFile(), getPrivateKeyFile(), Optional.empty()), new char[0]);

SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
Expand Down
5 changes: 5 additions & 0 deletions drift-transport-apache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<artifactId>concurrent</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>security</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>jmx</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.common.util.concurrent.ListeningScheduledExecutorService;
import io.airlift.drift.transport.client.MethodInvoker;
import io.airlift.drift.transport.client.MethodInvokerFactory;
import io.airlift.security.pem.PemReader;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocolFactory;
Expand Down

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
<version>1.3</version>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>security</artifactId>
<version>${dep.airlift.version}</version>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>stats</artifactId>
Expand Down

0 comments on commit 93e2b86

Please sign in to comment.