SSL-capable ServiceEmitter.

This commit is contained in:
Gian Merlino 2014-12-03 10:43:24 -08:00
parent 529e7e0272
commit 03ae70ae54
1 changed files with 10 additions and 2 deletions

View File

@ -20,6 +20,7 @@
package io.druid.server.initialization; package io.druid.server.initialization;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Throwables;
import com.google.common.base.Supplier; import com.google.common.base.Supplier;
import com.google.inject.Binder; import com.google.inject.Binder;
import com.google.inject.Module; import com.google.inject.Module;
@ -37,6 +38,7 @@ import io.druid.guice.ManageLifecycle;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import java.security.NoSuchAlgorithmException;
/** /**
*/ */
@ -47,8 +49,14 @@ public class HttpEmitterModule implements Module
{ {
JsonConfigProvider.bind(binder, "druid.emitter.http", HttpEmitterConfig.class); JsonConfigProvider.bind(binder, "druid.emitter.http", HttpEmitterConfig.class);
// Fix the injection of this if we want to enable ssl emission of events. final SSLContext context;
binder.bind(SSLContext.class).toProvider(Providers.<SSLContext>of(null)).in(LazySingleton.class); try {
context = SSLContext.getDefault();
} catch (NoSuchAlgorithmException e) {
throw Throwables.propagate(e);
}
binder.bind(SSLContext.class).toProvider(Providers.of(context)).in(LazySingleton.class);
} }
@Provides @Provides