# \[SSL\] Using gatling to test SSL secured web service

**URL:** <https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528>\
**Category:** Gatling (Open-Source)\
**Created:** [September 14, 2015, 3:10pm UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528 "2015-09-14T15:10:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHEN\_YANQING](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CHEN\_YANQING](https://community.gatling.io/u/CHEN_YANQING)\
**Post date:** [September 14, 2015, 3:10pm UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528/1 "2015-09-14T15:10:50Z")

</div>

Hello,

I’m having problem while running my test about a SSL secured web service.

I generated my certificates and installed them on a local tomcat server, tested it with SOAPUI, it worked correctly.

Now I’m trying to test it with gatling. But I always got the error when I run Engine:  
---- Errors --------------------------------------------------------------------

> status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 500

my configuration in gatling.conf as:  
_http {_  
_ssl {_  
_trustStore {_  
_file=“mytruststore.truststore”_  
_password=“password”_  
_}_  
_keyStore {_  
_file=“mykeystore.keystore”_  
_password=“password”_  
_}_  
_}_

Here is my senario:  
_import io.gatling.core.Predef.\__  
_import io.gatling.core.scenario.Simulation_  
_import io.gatling.core.session.Session_  
_import io.gatling.http.Predef.\__

_class SimpleTest extends Simulation {_

_val httpProtocol = http_  
_.baseURL(“[https://localhost:8443/](https://localhost:8443/)”)_  
_.acceptHeader(“text/html,text/xml,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)_  
_.acceptEncodingHeader(“gzip, deflate”)_  
_.acceptLanguageHeader(“fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3”)_  
_.connectionHeader(“Keep-Alive”)_  
_.userAgentHeader(“Apache-HttpClient/4.1.1 (java 1.5)”)_

_val scn = scenario(“SimpleTest”)_  
_.repeat(1) {_  
_exec(_  
_http(“TestLocal”)_  
_.post(“services/mySimple\_WS”)_  
_.body(StringBody(“”“”“”))_  
_.header(“Content-Type”, “”“text/xml;charset=UTF-8"”")_  
_.header(“Accept-Encoding”, “”“gzip, deflate”“”)_  
_.header(“Connection”, “”“keep-alive”“”)_  
_)_  
_}_

_setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)_  
_}_

Please help if you have any idea.

Regards,

---

<div class="post-metadata">

**Author:** ![CHEN\_YANQING](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CHEN\_YANQING](https://community.gatling.io/u/CHEN_YANQING)\
**Post date:** [September 14, 2015, 3:13pm UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528/2 "2015-09-14T15:13:20Z")

</div>

BTW  
I’m using Version 2.2.0-M2

---

<div class="post-metadata">

**Author:** ![william\_wu](https://avatars.discourse-cdn.com/v4/letter/w/a88e57/32.png) [@william\_wu](https://community.gatling.io/u/william_wu)\
**Post date:** [September 22, 2015, 12:34pm UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528/3 "2015-09-22T12:34:38Z")

</div>

Hello,

Aren’t suppose to set the SOAPAction in the header too ?

---

<div class="post-metadata">

**Author:** ![CHEN\_YANQING](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CHEN\_YANQING](https://community.gatling.io/u/CHEN_YANQING)\
**Post date:** [September 29, 2015, 8:06am UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528/4 "2015-09-29T08:06:30Z")

</div>

it works with “RawfileBody”…

```auto

```

---

<div class="post-metadata">

**Author:** ![CHEN\_YANQING](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CHEN\_YANQING](https://community.gatling.io/u/CHEN_YANQING)\
**Post date:** [September 29, 2015, 8:41am UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528/5 "2015-09-29T08:41:42Z")

</div>

Yes I set SOAPAction as well…

---

<div class="post-metadata">

**Author:** ![CHEN\_YANQING](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CHEN\_YANQING](https://community.gatling.io/u/CHEN_YANQING)\
**Post date:** [March 13, 2016, 9:18pm UTC](https://community.gatling.io/t/ssl-using-gatling-to-test-ssl-secured-web-service/2528/6 "2016-03-13T21:18:29Z")

</div>

Yes but it works now. Thx!
