diff --git a/prism-agent/service/server/src/main/resources/application.conf b/prism-agent/service/server/src/main/resources/application.conf index 1fd5185045..8d5b037a40 100644 --- a/prism-agent/service/server/src/main/resources/application.conf +++ b/prism-agent/service/server/src/main/resources/application.conf @@ -4,6 +4,8 @@ prismNode { host = ${?PRISM_NODE_HOST} port = 50053 port = ${?PRISM_NODE_PORT} + usePlainText = false + usePlainText = ${?PRISM_NODE_USE_PLAIN_TEXT} } } diff --git a/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/Modules.scala b/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/Modules.scala index 0282f36e06..fd60ac4fc4 100644 --- a/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/Modules.scala +++ b/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/Modules.scala @@ -126,9 +126,15 @@ object GrpcModule { .service[AppConfig] .map(_.prismNode.service) .flatMap(config => - ZIO.attempt( - NodeServiceGrpc.stub(ManagedChannelBuilder.forAddress(config.host, config.port).build) - ) + if (config.usePlainText) { + ZIO.attempt( + NodeServiceGrpc.stub(ManagedChannelBuilder.forAddress(config.host, config.port).usePlaintext().build) + ) + } else { + ZIO.attempt( + NodeServiceGrpc.stub(ManagedChannelBuilder.forAddress(config.host, config.port).build) + ) + } ) ) SystemModule.configLayer >>> stubLayer diff --git a/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/config/AppConfig.scala b/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/config/AppConfig.scala index cf98969a1f..b759281148 100644 --- a/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/config/AppConfig.scala +++ b/prism-agent/service/server/src/main/scala/io/iohk/atala/agent/server/config/AppConfig.scala @@ -48,7 +48,7 @@ final case class ConnectConfig( final case class PrismNodeConfig(service: GrpcServiceConfig) -final case class GrpcServiceConfig(host: String, port: Int) +final case class GrpcServiceConfig(host: String, port: Int, usePlainText: Boolean) final case class DatabaseConfig( host: String,