Skip to content

Commit

Permalink
Merge pull request #561 from http4s/update/series/1.x/armeria-1.31.0
Browse files Browse the repository at this point in the history
Update armeria to 1.31.0 in series/1.x
  • Loading branch information
danicheg authored Nov 19, 2024
2 parents 889069f + 1ae5119 commit 13b93c0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "1.0.0-M43"
val log4cats = "2.7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -258,7 +264,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`.
Expand All @@ -276,7 +287,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())
}
}
})
Expand All @@ -288,7 +303,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]].
Expand Down

0 comments on commit 13b93c0

Please sign in to comment.