Change SSL cert used in feeder per request?

Hi everyone, is it possible in Gatling to use feeder with different certificate for every request?

I’ve also asked this question on SO (, but a colleague pointed me to your google group.

Consider the test:

  • for a number of users, each has a personal, unique certificate used for HTTPS connection,
  • for every user, send a request, using that user’s certificate.

Example implementation:

val feeder = Array(
  Map("data" -> data(user1_data),
    "gatling.http.ssl.trustStore.file" -> "/tmp/test-data/rb.jks",
    "gatling.http.ssl.trustStore.password" -> "password",
    "gatling.http.ssl.keyStore.file" -> "/tmp/test-data/user1.jks",
    "gatling.http.ssl.keyStore.password" -> "password"),

  Map("data" -> data(user2_data),
    "gatling.http.ssl.trustStore.file" -> "/tmp/test-data/rb.jks",
    "gatling.http.ssl.trustStore.password" -> "password",
    "gatling.http.ssl.keyStore.file" -> "/tmp/test-data/user2.jks",
    "gatling.http.ssl.keyStore.password" -> "password")
val scn = scenario.exec(reportableTest(
  repeat(feeder.length) {
    .exec(http("test user personal data")

I did call: .disableClientSharing in scenario setup.

The weird behaviour is, it seems that only the first

"gatling.http.ssl.keyStore.file" -> "/tmp/test-data/user1.jks",

is processed. The next are not (even if I create another reportableTest). I’ve simply changed the order to see that in fact in both request the first “userX.jks” is being used.

Is this the normal behaviour? Is it a bug?

I’m running Gatling 2.1.4, the same behaviour occured in 2.1.2.

You get it wrong. You can use a different SSL config per virtual user, not per request.

Doesn’t that mean that if each virtual user does one request and then exits, each will have a different SSL config?

Thanks for help! As it turned out, these lines:

val scn = scenario.exec(reportableTest(
  repeat(feeder.length) {

caused all the feeder requests to be consumed by a single user, hence only on set of certs was used. Removing that, adding another user solved the issue (indeed, adding users helped).

W dniu wtorek, 24 lutego 2015 12:35:49 UTC+1 użytkownik Maciej Grzymkowski napisał:

Hi guys,

I am trying to feed certificates as part of HTTPS request as below :

val feeder_Certificates = Array(
“gatling.http.ssl.trustStore.file” → “/user-files/Certificates/nft_truststore.jks”,
“gatling.http.ssl.trustStore.password” → “password”,
“gatling.http.ssl.keyStore.file” → “/user-files/Certificates/nft_keystore.jks”,
“gatling.http.ssl.keyStore.password” → “password”))

println(">> Running simulation for " + duration + " seconds <<")

val ChannelSimulationScenario = scenario (“Channeltransactions”)
pace(40 seconds, 80 seconds)
.exec(App.InitialiseApp).pause(3 seconds, 7 seconds)
.exec(api.validateToken).pause(3 seconds, 7 seconds))

In the session I can see the reference to the trustStore file & KeyStore file however the certificates doesn’t get sent to the application.

Session(Channeltransactions,4659084711907998562-0,Map(gatling.http.ssl.keyStore.password → password, 764bba98-7210-45b7-9ca3-5f5f51f7b13f → 1455688053256, gatling.http.ssl.trustStore.password → password, gatling.http.ssl.keyStore.file → /user-files/Certificates/nft_keystore.jks, d24fc830-f69e-4a66-86fd-592969d12ebd → 0, timestamp.d24fc830-f69e-4a66-86fd-592969d12ebd → 1455687995035, gatling.http.ssl.trustStore.file → /user-files/Certificates/nft_truststore.jks),1455687995023,0,OK,List(ExitOnCompleteLoopBlock(d24fc830-f69e-4a66-86fd-592969d12ebd)),)

What could be wrong ? any help is appreciated