An example of getting Jmeter to work with NTLM

If you are reading this blog entry you are probably frustrated that jmeter does not always work with NTLM authentication. There have been very good blog posts on the subject. I particularly liked Alexander Kriegel blog. (http://agilitator.com/blog/?p=987) on the subject. Alexander provides an example of how to create a java program using the HTTP library used by Jmeter and another library that has a better implementation of NTLM.

The first thing I did was download NetBeans and recreated the project using his code. I was new to netbeans but found it easy to use. However, I did have a few problems getting is all to work. What I did find helpful was using the following command to execute the code as this provided additional debug information.

I needed the following command line switches to help debug

java -Dorg.apache.commons.logging.Log=org.apach
e.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.log.org.
apache.http=DEBUG -Dorg.apache.commons.logging.simplelog.log.org.apache.http.wir
e=DEBUG -jar YOURJAR.jar

With this and some helpful advice from Alex I got my code working in my environment. You may notice my question in the comments section of Alexander’s blog.

OK so I got my code work and next I needed to make the change to Jmeter. The first thing to do was to compile Jmeter from the source files. Here I found Artur Ejsmont blog the most upto date and useful on how to build Jmeter 2.7 (http://artur.ejsmont.org/blog/content/how-to-build-jmeter-from-sources-in-eclipse).

I did have some problems with downloading the jar needed and posted about that here (https://performancetestersdiary.wordpress.com/2012/09/09/jmeter-build-my-first-time-and-problem-with-jcharts-0-7-5-jar/
)

One other thing I found out was if you also have a site that supports kerbos and NTLM you need to ask the site admin to support only NTLM.

You can check he has done this by using fiddler to look at the returned header.

Advertisements

One thought on “An example of getting Jmeter to work with NTLM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s