5

I try to launch maven sonar:sonar to a SonarQube instance on HTTPS connection with a self-signed certificate. Maven give me this error:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project data.model: Unable to execute SonarQube: Fail to get bootstrap index from server: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

avojak
  • 2,197
  • 2
  • 29
  • 31
sintetico82
  • 441
  • 9
  • 22

1 Answers1

4

You can import the server certificate in your truststore:

keytool -import -v -trustcacerts -alias mySonarServer -file sonarServer.crt -keystore cacerts

Where cacerts is the one from the JRE installation.

  • 2
    I know this solution but i want that it is Maven to ignore this issue for agnostic platform execution – sintetico82 Jan 11 '18 at 17:30
  • 5
    JVM has no option to turn off certificate validation, Maven wagon has a few options: https://stackoverflow.com/questions/21252800/how-to-tell-maven-to-disregard-ssl-errors-and-trusting-all-certs But Sonar plugin doesn't use wagon and doesn't provide a way to disable SSL certificate validation. – Ondřej Xicht Světlík Jan 11 '18 at 17:41