K6 using NTLM Authentication for http1.1 engine

Hi K6 support team,
we are using NTLM authentication and our server responds with the HTTP/1.1 and if we make the similar request through the K6 script by using NTLM authentication the K6 responds with HTTP 2.0 and adding to that the NTLM authorization/authentication key should be generated if the authentication is successful in subsequent K6 requests which is not happening and due to this we are getting k6 request failure stating that HTTP_1_1_REQUIRED failure.

Error: time=“XXXXXXXXX” level=warning msg=“Request Failed” error=“XXXXXXX”: stream error: stream ID 3; HTTP_1_1_REQUIRED"

is there anyway we can fix this(or) workaround for this?

HI @ravi_k6,

The way that an http2 connections is made is such that both the server and the client need to support it an agree that … well that will be used. So this seems like a configuration issue on your server side - it shouldn’t propose/agree to upgrade to http2 if NTLM is going to be used.

As far as I understood from some comments online NTLM is just not supported with HTTP2, so maybe k6 shouldn’t even try to make http2 connection in NTLM authentication is configured?

Hi ravi,Is this problem solved? I also encountered this problem, as below show:
protocal :https
k6 version: 0.37.0
WARN[0000] Request Failed
error=“Get “https://user1:***@localhost/starandcatch/api/public/v1/star/agents/”: stream error: stream ID 1; HTTP_1_1_REQUIRED; received from peer”

Hi @lambda999,
We have not worked on that on either. In the current codebase not using HTTP2 when available and NTLM authentication will be hard to do - I just looked at it again. So if your server wants NTLM authentication, but also tell us to upgrade to HTTP2 - you will get this error. I would argue this is a problem with how the server is configured.

Somewhat luckily, k6 now has the ability to at least force HTTP/1.1 for the whole process through setting the env variable GODEBUG to http2client=0. On Linux you can do GODEBUG=http2client=0 k6 run testscript.js .

Hope this helps you !

1 Like

Hi mstoykov,

Really thanks for you explain for this issue, and I got it now.
For my issue: you provided the workaround of “setting the env variable GODEBUG to http2client=0” was fine and the error disappear, everything is ok for now, thanks

Regards
Lambda

1 Like