Issue Summary
Outbound proxy with authentication doesn't work for remote agents.
Steps to Reproduce
- Setup a squid proxy that requires basic auth.
- Configure wrapper.conf to route via outbound proxy:
wrapper.java.additional.3=-Dhttp.proxyHost=localhost wrapper.java.additional.4=-Dhttp.proxyPort=3128 wrapper.java.additional.5=-Dhttp.proxyUser=user wrapper.java.additional.6=-Dhttp.proxyPassword=pass
Expected Results
Agent HTTP client responds to Proxy-Authenticate challenge with Proxy-Authorization details.
Challenge response expectations for proxies detailed here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
Actual Results
Agent does not send Proxy-Authorization header initially which is aligned with no preemptive authentication, but it then however does not send another request with Proxy-Authorization after it receives 407 challenge from the proxy with Proxy-Authenticate details for modes of authentication.
Exchange observed in atlassian-bamboo-agent.log file:
INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "CONNECT url HTTP/1.1[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "Host: url[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_201)[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,235 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "HTTP/1.1 407 authenticationrequired[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,235 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Via: ...[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Date: Wed, 03 Feb 2021 02:16:47 GMT[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Content-Type: text/html[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Cache-Control: no-cache[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Content-Length: 2106[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "X-Frame-Options: deny[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Proxy-Connection: Keep-Alive[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Proxy-Authenticate: NTLM[\r][\n]" INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Proxy-Authenticate: Basic realm="..."[\r][\n]" ... INFO | jvm 1 | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,267 ERROR [WrapperSimpleAppMain] [AgentContext] An error has occurred when requesting fingerprint: HTTP/1.1 407 authenticationrequired INFO | jvm 1 | 2021/02/03 12:15:01 | Exiting due to fatal exception. INFO | jvm 1 | 2021/02/03 12:15:01 | com.atlassian.bamboo.agent.bootstrap.RemoteAgentHttpException: Response: [HTTP/1.1 407 authenticationrequired] received after fingerprint request. INFO | jvm 1 | 2021/02/03 12:15:01 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initFingerprint(AgentContext.java:156) INFO | jvm 1 | 2021/02/03 12:15:01 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initServerSession(AgentContext.java:101) INFO | jvm 1 | 2021/02/03 12:15:01 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.run(AgentContext.java:88) INFO | jvm 1 | 2021/02/03 12:15:01 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.run(AgentBootstrap.java:112) INFO | jvm 1 | 2021/02/03 12:15:01 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.main(AgentBootstrap.java:51) INFO | jvm 1 | 2021/02/03 12:15:01 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1 | 2021/02/03 12:15:01 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) INFO | jvm 1 | 2021/02/03 12:15:01 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2021/02/03 12:15:01 | at java.lang.reflect.Method.invoke(Method.java:498) INFO | jvm 1 | 2021/02/03 12:15:01 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349) INFO | jvm 1 | 2021/02/03 12:15:01 | at java.lang.Thread.run(Thread.java:748)
This is where it ends.
Workaround
No workaround known workaround available. Need to connect directly to your Bamboo Server without using an outbound proxy, or use a proxy that does not require authentication.
- relates to
-
BAM-14775 Add support for the http.proxyUser and http.proxyPassword on Git repositories
- Closed
- mentioned in