SSL certificate seems not being sent to server (web services)

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 -

Well, by using “disableClientSharing” everything worked fine.
For completeness:

`

val httpProtocol = http
.disableClientSharing
.baseURL(“https://addreess:4443”)
.inferHtmlResources()
.acceptEncodingHeader(“gzip,deflate”)
.connectionHeader(“close”)
.contentTypeHeader(“application/soap+xml;charset=UTF-8”)
.userAgentHeader(“Apache-HttpClient/4.1.1 (java 1.5)”)

`

You cannot set System props in the simulation to override Gatling conf file.
It’s too late, configuration has already been loaded (which is pretty obvious as you can configure in there the location of the simulations).

Ok, clear and it makes perfectly sense.

I never edited the gatling.conf file, in fact there I’ve:

http {
#fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable
#fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable
#perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable
#warmUpUrl = “http://gatling.io” # The URL to use to warm-up the HTTP stack (blank means disabled)
#enableGA = true # Very light Google Analytics, please support
ssl {
keyStore {
#type = “” # Type of SSLContext’s KeyManagers store
#file = “” # Location of SSLContext’s KeyManagers store
#password = “” # Password for SSLContext’s KeyManagers store
#algorithm = “” # Algorithm used SSLContext’s KeyManagers store
}
trustStore {
#type = “” # Type of SSLContext’s TrustManagers store
#file = “” # Location of SSLContext’s TrustManagers store
#password = “” # Password for SSLContext’s TrustManagers store
#algorithm = “” # Algorithm used by SSLContext’s TrustManagers store
}
}

Question: does it means that, even the properties being empty in the conf file, I cannot override them in my simulation file?

Thanks for your feedback.