From 6ae7cf40cd46be190d6184fc9a12e549cf202692 Mon Sep 17 00:00:00 2001 From: "http4s-steward[bot]" <106843772+http4s-steward[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:13:51 +0000 Subject: [PATCH 1/2] Update armeria to 1.31.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 57c8f6b..8a84a52 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ ThisBuild / resolvers += Resolver.mavenLocal ThisBuild / Test / javaOptions += "-Dcom.linecorp.armeria.verboseResponses=true -Dcom.linecorp.armeria.verboseExceptions=always" val versions = new { - val armeria = "1.30.1" + val armeria = "1.31.0" val fs2 = "3.11.0" val http4s = "0.23.29" val logback = "1.2.13" From a60c24af053ea04898b8ba02968eb73d23a6887b Mon Sep 17 00:00:00 2001 From: danicheg Date: Thu, 14 Nov 2024 20:47:55 +0300 Subject: [PATCH 2/2] Use TlsProvider in ArmeriaServerBuilder --- .../armeria/server/ArmeriaServerBuilder.scala | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/server/src/main/scala/org/http4s/armeria/server/ArmeriaServerBuilder.scala b/server/src/main/scala/org/http4s/armeria/server/ArmeriaServerBuilder.scala index 7df5035..7b35628 100644 --- a/server/src/main/scala/org/http4s/armeria/server/ArmeriaServerBuilder.scala +++ b/server/src/main/scala/org/http4s/armeria/server/ArmeriaServerBuilder.scala @@ -21,7 +21,13 @@ import cats.syntax.applicative._ import cats.syntax.flatMap._ import cats.syntax.functor._ import com.linecorp.armeria.common.util.Version -import com.linecorp.armeria.common.{HttpRequest, HttpResponse, SessionProtocol} +import com.linecorp.armeria.common.{ + HttpRequest, + HttpResponse, + SessionProtocol, + TlsKeyPair, + TlsProvider +} import com.linecorp.armeria.server.{ HttpService, HttpServiceWithRoutes, @@ -247,7 +253,12 @@ sealed class ArmeriaServerBuilder[F[_]] private ( * [[withTlsCustomizer]] */ def withTls(keyCertChainFile: File, keyFile: File, keyPassword: Option[String]): Self = - atBuild(_.tls(keyCertChainFile, keyFile, keyPassword.orNull)) + atBuild( + _.tlsProvider( + TlsProvider + .builder() + .keyPair(TlsKeyPair.of(keyFile, keyPassword.orNull, keyCertChainFile)) + .build())) /** Configures SSL or TLS of this [[com.linecorp.armeria.server.Server]] with the specified * `keyCertChainInputStream`, `keyInputStream` and `keyPassword`. @@ -265,7 +276,11 @@ sealed class ArmeriaServerBuilder[F[_]] private ( .both(keyInputStream) .use { case (keyCertChain, key) => F.delay { - ab.tls(keyCertChain, key, keyPassword.orNull) + ab.tlsProvider( + TlsProvider + .builder() + .keyPair(TlsKeyPair.of(key, keyPassword.orNull, keyCertChain)) + .build()) } } }) @@ -277,7 +292,12 @@ sealed class ArmeriaServerBuilder[F[_]] private ( * [[withTlsCustomizer]] */ def withTls(key: PrivateKey, keyCertChain: X509Certificate*): Self = - atBuild(_.tls(key, keyCertChain: _*)) + atBuild( + _.tlsProvider( + TlsProvider + .builder() + .keyPair(TlsKeyPair.of(key, keyCertChain: _*)) + .build())) /** Configures SSL or TLS of this [[com.linecorp.armeria.server.Server]] with the specified * [[javax.net.ssl.KeyManagerFactory]].