markusthoemmes commented on a change in pull request #4004: Enable running
basic system tests without requiring whisk.properties
URL:
https://github.com/apache/incubator-openwhisk/pull/4004#discussion_r218357549
##########
File path: tests/src/test/scala/system/rest/RestUtil.scala
##########
@@ -31,13 +31,14 @@ import spray.json._
*/
trait RestUtil {
- private val skipKeyStore = false // set this to true for convenient local
testing
+ private val skipKeyStore = WhiskProperties.isSSLCheckRelaxed
private val trustStorePassword = WhiskProperties.getSslCertificateChallenge
// force RestAssured to allow all hosts in SSL certificates
protected val sslconfig = {
new RestAssuredConfig().sslConfig(if (!skipKeyStore) {
- new SSLConfig().keystore("keystore",
trustStorePassword).allowAllHostnames()
+ if (trustStorePassword != null) new SSLConfig().keystore("keystore",
trustStorePassword).allowAllHostnames()
+ else new SSLConfig().allowAllHostnames()
} else {
new SSLConfig().relaxedHTTPSValidation().allowAllHostnames()
})
Review comment:
Can this be:
```scala
val sslConfig = {
val inner = new SSLConfig().allowAllHostnames()
if(!skipKeyStore && trustStorePassword != null) {
inner.keystore("keystore", trustStorePassword)
} else {
inner.relaxedHTTPSValidation()
}
new RestAssuredConfig().sslConfig(inner)
}
```
Cuts down on repetition a bit.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services