recorder and wildcard certificates

Hello,

I’ve tried the recorder from both gatling-charts-highcharts-1.4.7-bundle.tar.gz and gatling-charts-highcharts-2.0.0-M1-bundle.tar.gz.
It works for me on an apache server configured with a self signed certificate but I can’t record anything on a tomcat server using a wildcard certificate (self signed): *.example.com.

I’ve got the following error :
17:50:36.072 [WARN ] i.g.r.h.h.BrowserHttpsRequestHandler - Trying to connect to https://some.example.com:443, make sure you’ve accepted the recorder certificate for this site
22 avr. 2013 17:50:36 org.jboss.netty.channel.SimpleChannelHandler
ATTENTION: EXCEPTION, please implement io.gatling.recorder.http.handler.ServerHttpResponseHandler.exceptionCaught() for proper handling.
java.nio.channels.ClosedChannelException
at org.jboss.netty.handler.ssl.SslHandler$6.run(SslHandler.java:1583)
at org.jboss.netty.channel.socket.ChannelRunnableWrapper.run(ChannelRunnableWrapper.java:40)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:69)
at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:36)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:55)
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:1569)
at org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:468)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:351)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

On Fifrefox I’ve well accepted the gatling certificate but even after that, it still tries to load the page unsuccessfully.
Did someone already use gatling with wildcard certificates or should I open an issue?

Thanks in advance for your help.

Regards,
Jérémy

Hi,

Do you have a set up so that we can reproduce, please?

Stéphane

Hi,

I’ve made a wildcard certificate for *.eu-west-1.compute.amazonaws.com
I’ve configured apache2 with it and you can test the recorder on this link https://ec2-54-216-42-202.eu-west-1.compute.amazonaws.com/. It seems ok.
Unfortunately there is an issue while I configure it with tomcat6 https://ec2-54-216-42-202.eu-west-1.compute.amazonaws.com:8443/

Please test from your side and let me know when I can delete this EC2 instance.

To make your own setup you can install an Ubuntu 12.04 and generate your certificate like this :

$ sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/wildcard.eu-west-1.compute.amazonaws.com.pem -keyout /etc/apache2/ssl/wildcard.eu-west-1.compute.amazonaws.com.key
Generating a 1024 bit RSA private key
…++++++
…++++++
writing new private key to ‘/etc/apache2/ssl/wildcard.eu-west-1.compute.amazonaws.com.key’

Hi Jeremy,

I had no problem recording this page with 2.0.0-M1.

Forget about the warnings, we don’t check (and don’t think we can) if the certificate was indeed accepted.

Don’t also mind the ClosedEception, the Recorde probably doesn’t handle well keep alive. I hope to fix it someday…

My JVM is

java version “1.7.0_21”
Java™ SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot™ 64-Bit Server VM (build 23.21-b01, mixed mode)

What’s yours? Might be a JDK bug. OpenJDK I guess? Have you tried Oracle one?

Thanks a lot for your quick reply!

Your guess was right, my JVM was:
java version “1.6.0_27”
OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

I’ve tried the Oracle version:
java version “1.6.0_45”
Java™ SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot™ 64-Bit Server VM (build 20.45-b01, mixed mode)

But I still encountered the issue:
18:13:26.203 [WARN ] i.g.r.h.h.BrowserHttpsRequestHandler - Trying to connect to https://ec2-54-216-42-202.eu-west-1.compute.amazonaws.com:8443, make sure you’ve accepted the recorder certificate for this site
23 avr. 2013 18:13:26 org.jboss.netty.channel.SimpleChannelHandler
ATTENTION: EXCEPTION, please implement io.gatling.recorder.http.handler.ServerHttpResponseHandler.exceptionCaught() for proper handling.
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:198)
at sun.nio.ch.IOUtil.read(IOUtil.java:166)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:245)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
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:662)
23 avr. 2013 18:13:26 org.jboss.netty.channel.SimpleChannelHandler
ATTENTION: EXCEPTION, please implement io.gatling.recorder.http.handler.ServerHttpResponseHandler.exceptionCaught() for proper handling.
java.nio.channels.ClosedChannelException
at org.jboss.netty.handler.ssl.SslHandler$6.run(SslHandler.java:1583)
at org.jboss.netty.channel.socket.ChannelRunnableWrapper.run(ChannelRunnableWrapper.java:40)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:69)
at org.jboss.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:36)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:55)
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:1569)
at org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:468)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:351)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
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:662)

So I’ve updated to

java version “1.7.0_21”
Java™ SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot™ 64-Bit Server VM (build 23.21-b01, mixed mode)

And it seems ok now, thank you!
It would be great to update the requirements here https://github.com/excilys/gatling/wiki/Getting-Started
As it’s recommended to not run Gatling with JDK7.

Have a nice evening.

Jérémy

NIO is quite a beast and bugs are really JVM implementation related…
For example, it has been broken on OS X from 1.7_1 to 1.7_10.

You’re right, I’ll update the Getting Started guide.

Thanks a lot for your feedback,

Stéphane