# \[2.0.0-M3a -\> 2.0.0-SNAPSHOT\] HostnameVerifier exception

**URL:** https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203
**Category:** Gatling (Open-Source)
**Created:** [July 23, 2014, 2:27pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203 "2014-07-23T14:27:43Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 23, 2014, 2:27pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/1 "2014-07-23T14:27:43Z")

</div>

Was having some problems in 2.0.0-M3a with `exitHereIfFailed`, so as per [https://groups.google.com/forum/#!searchin/gatling/exithereiffailed/gatling/7ps9ic0g6GY/qWpvDghP4aYJ](https://groups.google.com/forum/#!searchin/gatling/exithereiffailed/gatling/7ps9ic0g6GY/qWpvDghP4aYJ) decided to give the SNAPSHOT a go.

Now I am seeing a lot of my requests failing like this:

java.net.ConnectException: HostnameVerifier exception

A bit of googling suggests this is an issue with the SSL config for AsyncHttpClient. Is there a simple way to configure this for Gatling?

Also is there a plan for another milestone release any time soon?

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 23, 2014, 2:49pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/2 "2014-07-23T14:49:26Z")

</div>

I’ll fix this for AHC 1.9.0-BETA3 and upgrade Gatling then.  
Probably tomorrow.

Sorry for the inconvenience,

Stéphane

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 23, 2014, 3:14pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/3 "2014-07-23T15:14:26Z")

</div>

No problem - thanks for the swift response. Just starting to build a trustStore file as that seems like the only workaround bar patching it myself (which would probably take a while).

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 23, 2014, 8:33pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/4 "2014-07-23T20:33:36Z")

</div>

I just pushed the AHC upgrade.

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 24, 2014, 10:38am UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/5 "2014-07-24T10:38:38Z")

</div>

Thanks for the quick turnaround!

That possibly fixes the problem, although we are now seeing:

java.lang.IllegalStateException: Client/Server mode not yet set.

A quick google suggests we need to call `[setUseClientMode](http://docs.oracle.com/javase/7/docs/api/javax/net/ssl/SSLEngine.html#setUseClientMode%28boolean%29)(true)` on `SSLEngine`. Any pointers on where to get the instance of SSLEngine from?

Also we had to add an extra dependency to our project:

group:“com.ning”, name:“async-http-client”, version:“1.9.0-BETA3”

I copied this from the `project/Dependencies.scala` in gatling, so perhaps this is just a local problem. Before this, we were seeing:

java.lang.ClassNotFoundException: com.ning.http.client.providers.netty.channel.pool.ChannelPool

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 24, 2014, 11:55am UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/6 "2014-07-24T11:55:10Z")

</div>

Arghhhhh.

Will fix in an hour or so.

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 24, 2014, 1:26pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/7 "2014-07-24T13:26:47Z")

</div>

I just released AHC 1.9.0-BETA4 and upgraded Gatling.

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 24, 2014, 1:37pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/8 "2014-07-24T13:37:04Z")

</div>

Thanks - we’ll try and test it out later this afternoon.

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 24, 2014, 4:11pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/9 "2014-07-24T16:11:22Z")

</div>

Getting the same issue, and it looks like I’ve got the latest libs:

ahc version = 1.9.0-BETA4  
gatling-charts-highcharts-2.0.0-SNAPSHOT.jar md5 = 8d46885b90d77a06a97e3a3e8de12996

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 24, 2014, 4:31pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/10 "2014-07-24T16:31:52Z")

</div>

You mean “java.lang.IllegalStateException: Client/Server mode not yet set”?  
I doubt it: [https://github.com/AsyncHttpClient/async-http-client/blob/async-http-client-1.9.0-BETA4/src/main/java/com/ning/http/client/providers/netty/channel/ChannelManager.java#L360](https://github.com/AsyncHttpClient/async-http-client/blob/async-http-client-1.9.0-BETA4/src/main/java/com/ning/http/client/providers/netty/channel/ChannelManager.java#L360)

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 24, 2014, 5:18pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/11 "2014-07-24T17:18:09Z")

</div>

Apologies for the lack of clarity - getting “java.net.ConnectException: HostnameVerifier exception” again, not " java.lang.IllegalStateException: Client/Server mode not yet set."

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 24, 2014, 5:53pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/12 "2014-07-24T17:53:36Z")

</div>

I just ran a test with a self-signed certificate website and I got the expected behavior:

- by default, everything runs fine, as acceptAnyCertificate defaults to true
- if I force acceptAnyCertificate to false, I get a “javax.net.ssl.SSLHandshakeException: General SSLEngine problem” as expected

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 25, 2014, 12:12pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/13 "2014-07-25T12:12:40Z")

</div>

You were right, there was still a problem: self-signed certificates where allowed, but non matching hostnames still weren’t.  
Fixed.

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 25, 2014, 4:53pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/14 "2014-07-25T16:53:57Z")

</div>

Thanks! We’ll try this on Monday.

---

<div class="post-metadata">

### Author: ![Alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex](https://community.gatling.io/u/Alex)
#### Post date: [July 29, 2014, 2:09pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/15 "2014-07-29T14:09:08Z")

</div>

FYI all working now, and latest SNAPSHOT also fixed some cookie problems we were having - thanks 🙂

---

<div class="post-metadata">

### Author: ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)
#### Post date: [July 29, 2014, 2:23pm UTC](https://community.gatling.io/t/2-0-0-m3a-2-0-0-snapshot-hostnameverifier-exception/1203/16 "2014-07-29T14:23:42Z")

</div>

Glad to hear.  
Thanks for your feedback.
