Hi folks,
I’m using gatling 2.2.2 to do a load test on a webservice interface.
The access to this interface is allowed only having a certificate.
I already have a truststore and a keystore. I verified both of them with the “keytool” application and
- the file exists
- the password is ok
- they contains the right stuff (private key, trusted CA…)
Basically, I’ve the same problem as asked here:
https://groups.google.com/d/msg/gatling/f8zdT-JP7qs/zxJ3zoI4AQAJ
This is my scala file I’m using.
Note: some parts were removed, private stuff, but believe me, I’m using absolute paths to be super sure to find the related trust and keystore files (verified with the “keytool” application of the JDK).
`
package none
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class TranferSimulation extends Simulation {
System.setProperty(“jsse.enableSNIExtension”, “false”)
//
// http://gatling.io/docs/2.2.2/http/http_ssl.html
System.setProperty(“gatling.http.ssl.trustStore.file”, “SeleniumKeystore”)
System.setProperty(“gatling.http.ssl.trustStore.password”, “selenium”)
System.setProperty(“gatling.http.ssl.keyStore.file”, “my_keystore.p12”)
System.setProperty(“gatling.http.ssl.keyStore.password”, “password”)
println(“Environment variables”)
println(" gatling.http.ssl.trustStore.file=" + System.getProperty(“gatling.http.ssl.trustStore.file”))
println(" gatling.http.ssl.trustStore.password=" + System.getProperty(“gatling.http.ssl.trustStore.password”))
println(" gatling.http.ssl.trustStore.type=" + System.getProperty(“gatling.http.ssl.trustStore.type”))
println(" gatling.http.ssl.keyStore.file=" + System.getProperty(“gatling.http.ssl.keyStore.file”))
println(" gatling.http.ssl.keyStore.password=" + System.getProperty(“gatling.http.ssl.keyStore.password”))
println(" gatling.http.ssl.keyStore.type=" + System.getProperty(“gatling.http.ssl.keyStore.type”))
println(" jsse.enableSNIExtension=" + System.getProperty(“jsse.enableSNIExtension”))
val httpProtocol = http
.baseURL(“https://address:4443”)
.inferHtmlResources()
.acceptEncodingHeader(“gzip,deflate”)
.connectionHeader(“close”)
.contentTypeHeader(“application/soap+xml;charset=UTF-8”)
.userAgentHeader(“Apache-HttpClient/4.1.1 (java 1.5)”)
val uri1 = “https://address:4443/web-module”
val feeder_Certificates = Array(
Map(
“gatling.http.ssl.trustStore.file” → System.getProperty(“gatling.http.ssl.trustStore.file”),
“gatling.http.ssl.trustStore.password” → System.getProperty(“gatling.http.ssl.trustStore.password”),
“gatling.http.ssl.keyStore.file” → System.getProperty(“gatling.http.ssl.keyStore.file”),
“gatling.http.ssl.keyStore.password” → System.getProperty(“gatling.http.ssl.keyStore.password”)))
val scn = scenario(“RecordedSimulation”)
.feed(feeder_Certificates)
.exec(http(“request_0”)
.post("/web-module/web10")
.body(RawFileBody(“content.txt”))
.check(status.is(200)))
setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}
`
Here the Gatling output:
`
Environment variables
gatling.http.ssl.trustStore.file=SeleniumKeystore
gatling.http.ssl.trustStore.password=selenium
gatling.http.ssl.trustStore.type=null
gatling.http.ssl.keyStore.file=my_keystore.p12
gatling.http.ssl.keyStore.password=password
gatling.http.ssl.keyStore.type=null
jsse.enableSNIExtension=false
12:08:01.072 [INFO ] i.g.h.a.HttpEngine - Start warm up
12:08:01.459 [INFO ] i.g.h.a.HttpEngine - Warm up done
Simulation none.TranferSimulation started…
12:08:01.697 [WARN ] i.g.h.a.ResponseProcessor - Request ‘request_0’ failed: status.find.is(200), but actually found 403
12:08:01.718 [DEBUG] i.g.h.a.ResponseProcessor -