Using JMeter WebSocket Samplers with an application that requires NTLM authentication.

Issue #197 wontfix
Cory Maluski created an issue

I am trying to use your WebSocket Sampler plugin to test an application that requires NTLM authentication, and given the configuration of the server (which cannot be changed in this case), the request to upgrade the connection can only be completed after sending the request 3 times (it inherently receives a 401 response the first two times, along with the NTLM negotiation; on the third request, the connection is upgraded).

Given how the WebSocket Sampler plugin is configured, the process quits with an error after receiving the first 401. Is it possible to force it to send the request to upgrade the connection a total of 3 times?

(In the attached screenshot, I had tried sending the request via HTTP request as a last ditch effort, but as I suspected would be the case, that did not work).

Any help you can provide would be much appreciated.

Comments (7)

  1. Peter Doornbosch repo owner

    I don’t get what you mean with “Given how the WebSocket Sampler plugin is configured, the process quits with an error after receiving the first 401.” Why can’t you simply use 3 “Open Websocket Connection” samplers in a row?

  2. Cory Maluski reporter

    Each “Open Websocket Connection” sampler starts a new TLS connection. I need to send three GETs with the same TLS connection.

    I’m attaching a debug log showing the entire process using a single HTTP Request Sampler as well as a debug log showing the execution of three successive WebSocket Samplers. The HTTP Request Sampler handles the negotiation and upgrade correctly; however, it obviously cannot communicate via the websocket. The WebSocket Sampler receives the first 401 and aborts.

  3. Cory Maluski reporter

    After looking over the debug logs more closely, I believe the solution to this issue would be to add support for the Authorization Manager to this plugin. Is this by chance something you plan on doing?

  4. Peter Doornbosch repo owner

    Each “Open Websocket Connection” sampler starts a new TLS connection. I need to send three GETs with the same TLS connection.

    This is a bit of a funny requirement, isn’t it? How the HTTP requests get to the server (whether or not over a TLS connection and than which) should be transparent.

    Anyway, maybe you can work around the issue by having a proxy setting up the TLS connection and than let JMeter talk to the proxy.

    Another option would be, to fork the plugin and change the WebSocketClient to cache the TLS connection i.s.o. creating a new one for each WS connection. Making this a generic feature would not be trivial because you would not to check the validity of the TLS connection before re-using, but if you just want to make it work for your specific case, this shouldn’t be too difficult i guess…

    Hth
    Peter

  5. Log in to comment