Proxy authentication doesn't work

Hello,
I’m using sonarqube-7.2.1 and I tried to update the plugin fron the marketplace, but without success.
The server is behind a proxy and I set the parameters in the sonar.properties:

HTTP proxy (default none)

http.proxyHost=xxx.internal
http.proxyPort=xxx

HTTPS proxy (defaults are values of http.proxyHost and http.proxyPort)

https.proxyHost=xxx.internal
https.proxyPort=xxx

NT domain name if NTLM proxy is used

#http.auth.ntlm.domain=

SOCKS proxy (default none)

#socksProxyHost=
#socksProxyPort=

Proxy authentication (used for HTTP, HTTPS and SOCKS proxies)

http.proxyUser=xxx
http.proxyPassword=xxx
https.proxyUser=xxx
https.proxyPassword=xxx

but when i click on the marketplace tab I receive the following error:
2018.10.02 17:05:54 DEBUG web[AWY1UEhIgFpPZemFAAAd][s.n.w.p.h.HttpURLConnection] sun.net.www.MessageHeader@387fc3ea8 pairs: {null: HTTP/1.1 407 Proxy Authentication Required}{Proxy-Authenticate: BASIC realm=“PROXY_INTERNET”}{Cache-Control: no-cache}{Pragma: no-cache}{Content-Type: text/html; charset=utf-8}{Proxy-Connection: close}{Connection: close}{Content-Length: 849}
2018.10.02 17:05:54 ERROR web[AWY1UEhIgFpPZemFAAAd][o.s.s.p.UpdateCenterClient] Fail to connect to update center
org.sonar.api.utils.SonarException: Fail to download: https://update.sonarsource.org/update-center.properties (HTTP proxy: xxx:xxx)

Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407 Proxy Authentication Required”

Do you have any hints about?

Kind regards
Silvio

Hi,

just pitching in with my comments.

We ran into this same problem when trying to configure proxy authentication for SonarQube 7.6.

In addition to what’s already been mentioned above, here are my observations:

  • http.proxyUser and http.proxyPassword (or https.proxyUser and https.proxyPassword) settings from sonar.properties are not passed to java as properties (at least I cannot see them in process arguments), unlike http(s).proxyHost and http(s).proxyPort settings
  • setting http(s).proxyUser and http(s).proxyPassword in sonar.properties’ sonar.web.javaAdditionalOpts passes the properties to java, but proxy connection still fails with same error as mentioned in the OP.

Has anyone looked into this yet?

Regards,
Martti

Hi ,

Updated, managed to solve it.

Add this in sonar.properties

# Same as previous property, but allows to not repeat all other settings like -Xmx
# https://www.oracle.com/technetwork/java/javase/8u111-relnotes-3124969.html 
sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djdk.http.auth.tunneling.disabledSchemes=""

Robin

Hi Robin,

Thanks for the update!

For the record, I believe this ticket which was fixed in 7.8 may be relevant: SONAR-11251.

 
Ann

1 Like