-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: http-request-plugin
-
None
-
Environment:HHTP Request Plugin 1.22
Jenkins 2.528.1
Between http-request-plugin 1.20 and 1.22, the support for NTLM authentication has been damaged.
Query like:
def response = httpRequest httpMode: 'GET', url: TEST_SERVER_ES5LIGEN, authentication: '5bxxx778', useNtlm: true, ignoreSslErrors: true
succeed with 1.20, but return http 401 with 1.22, which means that useNtlm: true has not been considered.
The Agent is running on Windows-Server 2016 with jdk-21.0.5+11, connected over SSH
I can reproduce this issue with a simple Pipeline:
pipeline {
agent { node { label 'WINDOWSAGENT' } }
stages {
stage('http') {
steps {
script {
def response = httpRequest httpMode: 'GET',
url: 'https://server.withntlmauthorisation.local',
authentication: '3bxxxx4777',
useNtlm: true,
ignoreSslErrors: true
println("Status: "+response.status)
println("Content: "+response.content)
}
}
}
}
}
Produce this Output in Jenkins:
HttpMethod: GET URL: https://server.withntlmauthorisation.local Using authentication: 3bxxxx4777 Sending request to url: https://server.withntlmauthorisation.local/ Response Code: 401 [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline hudson.AbortException: Fail: Status code 401 is not in the accepted range: 100:399 while calling https://server.withntlmauthorisation.local at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestExecution.responseCodeIsValid(HttpRequestExecution.java:490) at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestExecution.processResponse(HttpRequestExecution.java:500) at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:383) at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:292) Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to ESMEAPP06 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1916) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:384) at hudson.remoting.Channel.call(Channel.java:1108) at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:405) at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:384) at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:49) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: a24eb8f1-4834-406b-8e9a-4f6ce0269c45 Caused: java.lang.IllegalStateException at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:294) at PluginClassLoader for http_request//jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:87) at hudson.remoting.UserRequest.perform(UserRequest.java:225) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:391) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:81) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Finished: FAILURE
Regards, Éric.