0
votes

since update to 6.1 (not absolutly sure its since then), I am not able to connect to Update Center through our proxy, because the authentication will not be done by SonarQube! If I open the backend and go to Administration->System->Update Center I can see in the log file the following exception (very short version):

2016.12.15 11:54:11 ERROR web[][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: MY-PROXY-IP:8080)
(...)    
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 authenticationrequired"

It works some days ago! I tested the proxy configuration. On the same machine, Jenkins is using the same proxy settings without any problems!

In the file /opt/sonar/conf/sonar.properties I configured the following:

    #--------------------------------------------------------------------------------------------------
# UPDATE CENTER

# Update Center requires an internet connection to request http://update.sonarsource.org
# It is enabled by default.
#sonar.updatecenter.activate=true

# HTTP proxy (default none)
http.proxyHost=MY-PROXY-IP
http.proxyPort=8080
# HTTPS proxy (defaults are values of http.proxyHost and http.proxyPort)
#https.proxyHost=
#https.proxyPort=

# 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=MY-PROXY-USER
http.proxyPassword=MY-PROXY-PASSWORD

For me it looks like the authentication will not be done. I am not able to look into the proxy server´s log file.

1
Note that if your proxy username contains "\" (backslash), then it should be escaped - for example username "domain\user" in file should look like: http.proxyUser=domain\\usergile
Thanks for the answer. Username and password does not have any special characters. Just A-Za-z0-9Felix Beucke
Did the proxy change in last days? As workaround you could install cntlmgile
No it doesnt. Today I tried another proxy server with the same result.Felix Beucke
I had a similar problem a couple of years ago and, if I remember, I fixed it configuring proxy in wrapper.conf instead of sonar.properties, but it shouldn't be the case in current sonarqube release. If you don't get a solution, try demanding proxy authentication to cntlm.gile

1 Answers

3
votes

I had similar problem. In my case it caused by JDK scheduled change. Disable Basic authentication for HTTPS tunneling of 8u111 Update Release.

I can workaround to append a property in /opt/sonar/conf/sonar.properties as follows.

sonar.web.javaAdditionalOpts=-Djdk.http.auth.tunneling.disabledSchemes=""