Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven sonar plugin: trust self-signed certificate

Tags:

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]

like image 973
sintetico82 Avatar asked Jan 11 '18 16:01

sintetico82


1 Answers

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.

like image 144
Ondřej Xicht Světlík Avatar answered Sep 23 '22 13:09

Ondřej Xicht Světlík