Skip to content
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
20 changes: 12 additions & 8 deletions akka-stream-tests/src/test/scala/akka/stream/io/TlsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object TlsSpec {

val rnd = new Random

val TLS12Ciphers: Set[String] = Set("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA")
val TLS12Ciphers: Set[String] = Set("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384")
val TLS13Ciphers: Set[String] = Set("TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384")

def initWithTrust(trustPath: String, protocol: String): SSLContext = {
Expand Down Expand Up @@ -368,14 +368,16 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing

object SessionRenegotiationFirstOne extends PayloadScenario {
override def flow = logCipherSuite
def inputs = NegotiateNewSession.withCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA") :: send("hello") :: Nil
def output = ByteString("TLS_RSA_WITH_AES_128_CBC_SHAhello")
def inputs =
NegotiateNewSession.withCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256") :: send("hello") :: Nil
def output = ByteString("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256hello")
}

object SessionRenegotiationFirstTwo extends PayloadScenario {
override def flow = logCipherSuite
def inputs = NegotiateNewSession.withCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA") :: send("hello") :: Nil
def output = ByteString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHAhello")
def inputs =
NegotiateNewSession.withCipherSuites("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384") :: send("hello") :: Nil
def output = ByteString("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384hello")
}

val scenarios =
Expand All @@ -392,9 +394,11 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
LHSIgnoresBoth,
BothSidesIgnoreBoth) ++
(if (protocol == "TLSv1.2")
Seq(SessionRenegotiationBySender, SessionRenegotiationByReceiver, SessionRenegotiationFirstTwo) ++
// RSA cipher suites disabled by default in JDK 24 and later
(if (JavaVersion.majorVersion < 24) Seq(SessionRenegotiationFirstOne) else Nil)
Seq(
SessionRenegotiationBySender,
SessionRenegotiationByReceiver,
SessionRenegotiationFirstTwo,
SessionRenegotiationFirstOne)
else // TLSv1.3 doesn't support renegotiation
Nil)

Expand Down