+act,rem,str add SECURITY marker to logs (#21749)

* +act,rem,str add SECURITY marker to logs

* Update TlsSpec.scala
This commit is contained in:
Konrad Malawski 2016-10-28 14:52:17 +02:00 committed by GitHub
parent 9be7df1527
commit 92671e6d98
14 changed files with 132 additions and 66 deletions

View file

@ -6,17 +6,21 @@ package akka.remote
import akka.testkit._
import akka.actor._
import com.typesafe.config._
import scala.concurrent.Future
import scala.reflect.classTag
import akka.pattern.ask
import java.security.{ NoSuchAlgorithmException }
import java.security.NoSuchAlgorithmException
import akka.util.Timeout
import scala.concurrent.Await
import scala.concurrent.duration._
import akka.event.{ NoLogging }
import akka.remote.transport.netty.{ SSLSettings, NettySSLSupport }
import akka.event.{ NoLogging, NoMarkerLogging }
import akka.remote.transport.netty.{ NettySSLSupport, SSLSettings }
import Configuration.{ CipherConfig, getCipherConfig }
import org.uncommons.maths.random.RandomDotOrgSeedGenerator
import scala.util.control.NonFatal
object Configuration {
@ -63,13 +67,13 @@ object Configuration {
val fullConfig = config.withFallback(AkkaSpec.testConf).withFallback(ConfigFactory.load).getConfig("akka.remote.netty.ssl.security")
val settings = new SSLSettings(fullConfig)
val rng = NettySSLSupport.initializeCustomSecureRandom(settings.SSLRandomNumberGenerator, NoLogging)
val rng = NettySSLSupport.initializeCustomSecureRandom(settings.SSLRandomNumberGenerator, NoMarkerLogging)
rng.nextInt() // Has to work
val sRng = settings.SSLRandomNumberGenerator
rng.getAlgorithm == sRng || (throw new NoSuchAlgorithmException(sRng))
val engine = NettySSLSupport.initializeClientSSL(settings, NoLogging).getEngine
val engine = NettySSLSupport.initializeClientSSL(settings, NoMarkerLogging).getEngine
val gotAllSupported = enabled.toSet diff engine.getSupportedCipherSuites.toSet
val gotAllEnabled = enabled.toSet diff engine.getEnabledCipherSuites.toSet
gotAllSupported.isEmpty || (throw new IllegalArgumentException("Cipher Suite not supported: " + gotAllSupported))