Sonar-scanner cli is failing with PKIX path security issue in jenkins

We installed sonar-scanner cli in our Jenkins environment and using the below command in Jenkins freestyle job to scan the application.

sonar-scanner -Dsonar.projectName=abcd -Dsonar.projectVersion=1.0.10 -Dsonar.host.url=https://sonarqube.corp.abc.net -Djavax.net.ssl.trustStorePassword=xyz -Djavax.net.ssl.trustStore=/tmp/sonar-certs/abc_sonarqube.jks

but the scan is failing with the below error

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

sonar version : Community Edition , Version 8.4.2 (build 36762)
sonar-scanner version : 4.6.0.2311

Help appreciated!!

Hi @sakethaligama ,

Welcome to SonarSource Community! :sonarsource:

You need to ensure that you import the correct cert into your Java truststore, most likely. See this link for more information. Even though you aren’t using Cloudbees, it is a similar resolution: PKIX path building failed error message – CloudBees Support