Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write exception reports into the log-file in case of SSL misconfiguration [DPP-759] #11776 #11788

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package com.daml.platform.apiserver

import java.util.concurrent.Executor

import com.daml.ledger.api.tls.TlsConfiguration
import com.daml.ledger.resources.{Resource, ResourceContext, ResourceOwner}
import com.daml.logging.{ContextualizedLogger, LoggingContext}
Expand All @@ -13,6 +12,7 @@ import com.daml.ports.Port
import io.grpc.ServerInterceptor

import scala.concurrent.{Future, Promise}
import scala.util.{Failure, Success}

private[daml] final class LedgerApiServer(
apiServicesOwner: ResourceOwner[ApiServices],
Expand All @@ -32,7 +32,7 @@ private[daml] final class LedgerApiServer(
val servicesClosedPromise = Promise[Unit]()

val apiServicesResource = apiServicesOwner.acquire()
for {
(for {
apiServices <- apiServicesResource
sslContext = tlsConfiguration.flatMap(_.server)
_ = tlsConfiguration.map(_.setJvmTlsProperties())
Expand Down Expand Up @@ -65,6 +65,11 @@ private[daml] final class LedgerApiServer(
override def servicesClosed(): Future[Unit] =
servicesClosedPromise.future
}
}).transformWith {
case Failure(ex) =>
logger.error("Failed to create LedgerApiServer", ex)
Resource.failed(ex)
case Success(s) => Resource.successful(s)
}
}
}