2

Have a Sonar instance running behind basic auth (not Sonar auth).

Using the Sonar Gradle plugin and specifying the Sonar host URL in gradle.properties via:

systemProp.sonar.host.url=https://admin:password@sonarqube.host.com

However this does not seem to authenticate as in Gradle logs I see:

SonarQube server [https://admin:password@sonarqube.host.com] can not be reached

If I curl the same URL I get a 200 response as expected.

Not sure why the sonar.host.url isn't playing nicely?

timothyclifford
  • 6,799
  • 7
  • 57
  • 85

2 Answers2

1

Two things:

  • proxy authentication between SonarQube Scanner and Server is only supported since SonarQube 6.1 ( SONAR-8084 )

  • with the above, http.proxyUser and http.proxyPassword are leveraged for basic proxy authentication (and you can leave sonar.host.url to the actual HTTP URL)

Nicolas B.
  • 7,245
  • 17
  • 29
1

I'm not sure if my answer helps with the gradle plugin.

The maven plugin has the problem, that the first request does not use any credentials when calling /batch/index and I had to omit that route from basic auth. I think it's worth checking if that's the case here too. Even using user:password@server was ignored completely by the plugin for the first call and I had no luck with sonar.useror any proxy user setup.

More details concerning my setup in my answer for the maven runner: https://stackoverflow.com/a/60132667/1838233

Arigion
  • 3,267
  • 31
  • 41