Gatling Multipart Requests over SSL

Hi all,

I’m hitting a very strange behaviour with trying to run some of our Gatling tests over HTTPS.

The tests work correctly over HTTP.

Switching to HTTPS, the tests that involve Multipart Mime Posts, e.g.:
var buildRequest = http(name + “_post_f”).post(base + action)
buildRequest = buildRequest.bodyPart(RawFileBodyPart(“file”, file, “application/octet-stream”).withFileName(“test.pdf”))
buildRequest = buildRequest.bodyPart(StringBodyPart(“apikey”, apikey))

are all failing.

Tests that use GET or non-multi-part Mime POSTS are working fine.

What seems to be happening is that the target is closing the connection shortly after the request has been received, because it is receiving an unexpected junk character after the request.

If I wireshark the connection (see attached files), gatling seems to be correctly sending the request (packet 23) and then separately sends an additional junk “-” character (packet 24)

Has anyone else seen anything like this?


We saw some some issues before summer in galting 2.

Stephane fixed everything during the summer - if you run from master, this should be ok (however, right now master HEAD is having issues, but you can build commit fb8c779 which works ok)



@Stefan, I’ve just fixed the issues you reported on master (also implemented the feature). A snapshot will be available soon on Sonatype.

@Dave, this is a bit old in my mind, so I can’t recall for sure if this is something that’s fixed in Netty/AsyncHttpClient. You might want to try to upgrade just the deps. Latest Netty 3 is 3.7.0.Final and AHC 1.7.21.
Please let me know if upgrading to Gatling master or upgrading the deps fix the problem. If not, the problem is either in AHC or Netty and I will dig deeper…

You rock!


Thanks for the suggestions.

Is there any info anywhere on how to build and run Gatling from source?

I’m currently using the maven plugin, which I guess is limited to using the released version.

I did have a hunt around the wiki, but didn’t find much.


First of all, beware that there’s 2 distinct projects due to licence issues:

Then, Gatling 1 was built with maven, while Gatling 2 is now built with sbt. Basically, you just have to clone the projects from github or even just download a tarball, then either mvn clean install or sbt package.
If building yourself is too complex, you can just fetch a snapshot from our continuous integration. Snapshots are hosted on Sonatype ( and next Gatling 2 releases will be on central.

I build/use gatling 2 code like this:

git clone
sbt clean publish-m2

git clone
sbt clean publish-m2

BTW, if you’re on mac os, you can install sbt using homebrew:
brew install sbt

git clone
mvn clean install

Generate new project using maven archetype:

mvn archetype:generate -DarchetypeVersion=2.0.0-SNAPSHOT -DarchetypeArtifactId=gatling-highcharts-maven-archetype -DarchetypeGroupId=io.gatling.highcharts

(remove repository in pom.xml)

If you need the maven plugin for running tests usin mvn test
git clone

mvn clean install



Dave, Stefan,

Some multipart related issues have just been raised on AsyncHttpClient:
I think they could match yours.
We’ll probably need a few days to sort this out, have a fix released for AHC and then update Gatling.

Stay tuned.

Hi all,

Thanks for all the support, it’s much appreciated!

So far I have only experienced multipart issues when running over HTTPS. Sounds like the recent AHC issues are more generic.

I’ll try to build from master today, and see if that resolves anything.


AHC doesn’t use the same code with HTTP and HTTPS. This could really match.

I was seeing lots of issues when doing https / multipart stuff before summer, but it all went away after one of the upgrades of ahc this summer.



Again, thanks for all the help on this.

Today I switched over to using a build of the latest master branch from git (following Stefan’s instructions)

I had to make quite a few code changes (I guess the APIs are still evolving), but nothing too major.

Good news is that this seems to have resolved all of the Multipart/SSL issues that I was seeing.

What’s the rough timescale for the next milestone release?


That’s very good news!

We’ll try our best to release M4 by the end of the year.


Hi Stephane,

I am trying to test multipart/related POST request using gatling.

The gatling script is attached. Please let me know how to make this work.

I am seeing a 500 internal error.

I have to upload an xml file and a jpeg file as part of POST request which uses multipart/related mime.

The xml file will not take any file name , but the png or jpeg file has the name “image”.

Also let me know which gatling snapshot should i use ?


ICN.scala (1.78 KB)