Specs:
SonarQube Version: 9.9
SonarScanner for MSBuild 5.11
Deployment mechanism: Zip
Language: C# (.NET Core 6)
OS hosting SonarQube: Ubuntu 20.04
OS running Scan: Windows 10
We have SonarQube version 9.9 instance installed on Ubuntu 20.04. Server is funning fine and configured correctly. However, once we started scanning, the scanner cannot talk to the server to post the scan findings. I received the below error:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Scan & Build Commands:
dotnet sonarscanner begin /k:"Project.Sandbox" /d:sonar.login="sqa_REDACTED" /d:sonar.verbose=true /d:sonar.branch.name="main" /d:sonar.host.url=https://sonar.some-domain-name.com
dotnet build .\Building.Data.sln /p:PackageVersion=$SemanticVersion /t:Publish /p:version=$SemanticVersion /p:restore=True -c "Release" -v normal --force
dotnet sonarscanner end /d:sonar.login="sqa_REDACTED"
RESULT:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Recommended Solution I tried:
keytool -import -alias SonarCert -keystore "C:\Program Files\Java\jdk-11\lib\security\cacerts" -file C:\PROJECTS\Certificates\sonar-server-cert.crt
Even after adding the cert to the keystore, I still get the same error. I tried on different machine and did the same thing and always get the same error.
What am I missing or doing wrong?
Thanks everyone!