diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/workers/MessagePersisterServiceCommand.java b/service/src/main/java/org/whispersystems/textsecuregcm/workers/MessagePersisterServiceCommand.java index 624e20d1a..c21c6b737 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/workers/MessagePersisterServiceCommand.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/workers/MessagePersisterServiceCommand.java @@ -7,8 +7,10 @@ package org.whispersystems.textsecuregcm.workers; import io.dropwizard.core.Application; import io.dropwizard.core.cli.ServerCommand; +import io.dropwizard.core.server.DefaultServerFactory; import io.dropwizard.core.setup.Environment; import java.time.Duration; +import io.dropwizard.jetty.HttpsConnectorFactory; import net.sourceforge.argparse4j.inf.Namespace; import net.sourceforge.argparse4j.inf.Subparser; import org.whispersystems.textsecuregcm.WhisperServerConfiguration; @@ -50,6 +52,15 @@ public class MessagePersisterServiceCommand extends ServerCommand { + if (connectorFactory instanceof HttpsConnectorFactory h) { + h.setKeyStorePassword(configuration.getTlsKeyStoreConfiguration().password().value()); + } + }); + } + final CommandDependencies deps = CommandDependencies.build("message-persister-service", environment, configuration); final DynamicConfigurationManager dynamicConfigurationManager = new DynamicConfigurationManager<>( diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/workers/ScheduledApnPushNotificationSenderServiceCommand.java b/service/src/main/java/org/whispersystems/textsecuregcm/workers/ScheduledApnPushNotificationSenderServiceCommand.java index 2e77167f2..cb0e4a15c 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/workers/ScheduledApnPushNotificationSenderServiceCommand.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/workers/ScheduledApnPushNotificationSenderServiceCommand.java @@ -9,8 +9,9 @@ import static com.codahale.metrics.MetricRegistry.name; import io.dropwizard.core.Application; import io.dropwizard.core.cli.ServerCommand; +import io.dropwizard.core.server.DefaultServerFactory; import io.dropwizard.core.setup.Environment; -import java.util.Optional; +import io.dropwizard.jetty.HttpsConnectorFactory; import java.util.concurrent.ExecutorService; import net.sourceforge.argparse4j.inf.Namespace; import net.sourceforge.argparse4j.inf.Subparser; @@ -53,6 +54,15 @@ public class ScheduledApnPushNotificationSenderServiceCommand extends ServerComm MetricsUtil.configureRegistries(configuration, environment); + if (configuration.getServerFactory() instanceof DefaultServerFactory defaultServerFactory) { + defaultServerFactory.getApplicationConnectors() + .forEach(connectorFactory -> { + if (connectorFactory instanceof HttpsConnectorFactory h) { + h.setKeyStorePassword(configuration.getTlsKeyStoreConfiguration().password().value()); + } + }); + } + final CommandDependencies deps = CommandDependencies.build("scheduled-apn-sender", environment, configuration); final FaultTolerantRedisCluster pushSchedulerCluster = new FaultTolerantRedisCluster("push_scheduler",