Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube : From https://mysonarqubeinstance.local/admin/system : 18.104.22.168736
scanner for .Net :
dotnet tool list -g
ID de package Version Commandes
dotnet-sonarscanner 5.5.3 dotnet-sonarscanner
- what are you trying to achieve
Sending a first report to the SonarQube instance for the project test
dotnet sonarscanner begin /k:Test /d:sonar.cs.opencover.reportsPaths=MyProjectTests/coverage.opencover.xml /d:sonar.coverage.exclusions="*Test.cs" /d:sonar.host.url=“https://mysonarqubeinstance.local” /d:sonar.login=“MYTOKEN”
dotnet build --no-restore
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --no-restore
dotnet sonarscanner end /d:sonar.login=“MYTOKEN”
Getting Error :
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I’m trying to make it work from a local windows computer.
- what have you tried so far to achieve this
I’m not an expert in Java, so for the moment I tried to investigate how to solve this. I came across multiple article stating that I need to create a local keystore or add the certificate to the keystore of the local JRE but afterward I don’t know what to do with this information.
Unable to find valid certification path to requested target · Issue #40 · ciricihq/gitlab-sonar-scanner (github.com)
For the moment I exported my certificate from the site with the command :
echo -n | openssl s_client -connect mysonarqubeinstance.local:443 | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > ./cert.cert
Afterwards, I don’t know how to import it in the local JRE keystore of the dotnet-sonar-scanner or how to use a brand local keystore with the instance to get rid of the error.
Can someone tell me what are the next steps to be able to force the downloaded certificate to be used with the sonarqube scanner ?
Thanks in advance,