HTTPS requests with internal proxy are hanging

Hello all. I’m having real trouble getting Gattling to record an HTTPS session. I have a company proxy listening for HTTP/S on the same port (80) and I’ve set it up on the Gatling config.
When I hit the page, I get the SSL warning, accept the certificate and then…nothing. The browser hangs and the Gatling console has this error (host redacted):

17:07:28.480 [WARN ] i.g.r.h.h.BrowserHttpsRequestHandler - Trying to connect to
https://[xxxxx].com:443, make sure you’ve accepted the
recorder certificate for this site
17:07:28.568 [WARN ] i.g.r.h.h.BrowserHttpsRequestHandler - Trying to connect to
https://[xxx].com:443, make sure you’ve accepted the
recorder certificate for this site
Dec 06, 2013 5:07:28 PM org.jboss.netty.channel.SimpleChannelHandler
WARNING: EXCEPTION, please implement io.gatling.recorder.http.handler.ServerHttp
ResponseHandler.exceptionCaught() for proper handling.
java.io.IOException: An established connection was aborted by the software in yo
ur host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(Abstract
NioWorker.java:109)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNi
oSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW
orker.java:90)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Dec 06, 2013 5:07:28 PM org.jboss.netty.channel.SimpleChannelHandler
WARNING: EXCEPTION, please implement io.gatling.recorder.http.handler.ServerHttp
ResponseHandler.exceptionCaught() for proper handling.
java.nio.channels.ClosedChannelException
at org.jboss.netty.handler.ssl.SslHandler$6.run(SslHandler.java:1580)
at org.jboss.netty.channel.socket.ChannelRunnableWrapper.run(ChannelRunn
ableWrapper.java:40)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThrea
d(AbstractNioWorker.java:71)
at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWor
ker.java:36)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThrea
d(AbstractNioWorker.java:57)
at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWor
ker.java:36)
at org.jboss.netty.channel.socket.nio.AbstractNioChannelSink.execute(Abs
tractNioChannelSink.java:34)
at org.jboss.netty.handler.ssl.SslHandler.channelClosed(SslHandler.java:
1566)
at org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:468)

at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNi
oWorker.java:376)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(Abstract
NioWorker.java:109)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNi
oSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW
orker.java:90)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Is there anything obvious I’m missing ?

Thanks!

Which version do you use?

Hi Stephane, 2.0m3 but I’ve also had the same issues with 1.5.x

As a workaround, could you try the HAR support in 2M3? https://github.com/excilys/gatling/wiki/Gatling%202#wiki-recorder

I tried but it was unable to convert the HAR file. The other issue is that there are login redirections involved before I hit the actual site so the HAR file won’t have the complete picture (guessing here, not sure).

Thanks!

What happened with the HAR conversion?
Did you get an exception?

cheers
Nicolas

IIRC, there was an issue with HAR that’s been fixed in master. Have you tried the snapshot?
https://github.com/excilys/gatling/wiki/Continuous-Integration

No I’ll give it ago, thanks

Hi Ioannis,

I’ve managed to fix this on master: https://github.com/excilys/gatling/issues/1545

I’m crossing fingers it will work with your proxy (I only tested locally with Charles, both with http and https)

Please wait ~20 min and you’ll get a snapshot on Sonatype.

Thanks for reporting,

Stéphane

That’s awesome Stephane, thanks for your hard work :slight_smile: I will be giving it a test spin later.

Well, first give it a try, then tell me if it’s awesome or crap… :wink:

Will do now :slight_smile:
When you say it’s available on Sonatype, you mean search.maven.org ?

No, there’s no snapshot on maven central.

Sonatype provides snapshots hosting and releases staging.
https://github.com/excilys/gatling/wiki/Continuous-Integration

Merci :slight_smile:

De rien :slight_smile:

Semi success. I can now visit a secure page over the proxy, but when I submit a form on the page I get this in the Gatling logs

WARNING: EXCEPTION, please implement io.gatling.recorder.http.handler.ServerHttpResponseHandler.exceptionCaught() for proper handling.
java.nio.channels.ClosedChannelException
at org.jboss.netty.handler.ssl.SslHandler$7.run(SslHandler.java:1605)
at org.jboss.netty.channel.socket.ChannelRunnableWrapper.run(ChannelRunnableWrapper.java:40)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:70)
at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:36)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:56)
at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:36)
at org.jboss.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:34)
at org.jboss.netty.handler.ssl.SslHandler.channelClosed(SslHandler.java:1591)
at org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:468)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:375)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Dec 11, 2013 2:06:06 PM org.jboss.netty.channel.SimpleChannelHandler

Damn, seems the server or the proxy is closing the connection for whatever reason.
Will try to reproduce, but that will have to wait a bit, sorry…