Working behind a proxy that requires user authentication was causing connection error (407) between local and the service server requests.
When the http.proxyUser system property is available and using Apache HttpClient, just add the user credentials (http.proxyUser and http.proxyPassword) to the proxy scope.
Implementation based on Apache HttpClient official documentation that worked on my environment. The Unit Tests were ignored, so I leave it as is.
Windows Servers requires NTLM Authentication and the API doesn't support it. Despite the WARN message bellow, the connection was completed successfully.
WARN org.apache.http.impl.auth.HttpAuthenticator- NTLM authentication error: Credentials cannot be used for NTLM authentication: org.apache.http.auth.UsernamePasswordCredentials
Working behind a proxy that requires user authentication was causing connection error (407) between local and the service server requests.
When the
http.proxyUser
system property is available and using Apache HttpClient, just add the user credentials (http.proxyUser
andhttp.proxyPassword
) to theproxy
scope.Implementation based on Apache HttpClient official documentation that worked on my environment. The Unit Tests were ignored, so I leave it as is.
Windows Servers requires NTLM Authentication and the API doesn't support it. Despite the WARN message bellow, the connection was completed successfully.
WARN org.apache.http.impl.auth.HttpAuthenticator- NTLM authentication error: Credentials cannot be used for NTLM authentication: org.apache.http.auth.UsernamePasswordCredentials
Reference: http://stackoverflow.com/questions/6962047/apache-httpclient-4-1-proxy-authentication