Skip to content

Commit

Permalink
drop that API sketch, it breaks things
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren committed Sep 4, 2024
1 parent 5f7b740 commit 46cfe33
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

package akka.grpc.interop

import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.grpc.GrpcClientSettings
import akka.http.scaladsl.common.SSLContextFactory
import io.grpc.internal.testing.TestUtils
import io.grpc.testing.integration2.{ ClientTester, Settings, TestServiceClient }
import io.grpc.testing.integration2.ClientTester
import io.grpc.testing.integration2.Settings
import io.grpc.testing.integration2.TestServiceClient

import java.nio.file.Paths
import scala.concurrent.Await
import scala.concurrent.duration._

// TODO #151 use our own Settings object
final case class AkkaGrpcClientScala(clientTesterFactory: Settings => ActorSystem => ClientTester) extends GrpcClient {
Expand All @@ -25,16 +24,6 @@ final case class AkkaGrpcClientScala(clientTesterFactory: Settings => ActorSyste
val client = new TestServiceClient(clientTesterFactory(settings)(sys))
client.setUp()

// alternatively `.withSslContext` directly from a SSLContextFactory.createSSLContextFromPem if not
// rotating certs
GrpcClientSettings
.fromConfig(sys.settings.config)
.withSslContextProvider(SSLContextFactory.refreshingSSLContextProvider(5.minutes)(() =>
SSLContextFactory.createSSLContextFromPem(
certificatePath = Paths.get("/some/path/server.crt"),
privateKeyPath = Paths.get("/some/path/server.key"),
trustedCaCertificatePaths = Seq(Paths.get("/some/path/serverCA.crt")))))

try client.run(settings)
finally {
client.tearDown()
Expand Down

0 comments on commit 46cfe33

Please sign in to comment.