I try to run de sonar-scanner.bat analyzer over my python repository, but the sonar server is private
I got this error:
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I tried to run this command in Windows.
Also, I can configure the same analyzer but for another project, in this case, a JAVA project. I add the cert.pem file into the Java keystore, but… How can I also add the cert.pem file for this project in python?
You’ve correctly diagnosed this as a problem with the certificate, but there’s nothing to import into Python. You need to get it fully imported into your Java trust store. The docs may help.
For my test in the repository with Java, I have added the certificate to the java keystore in windows: “C:\Program Files\Java\jdk-18.0.2.1\lib\security\cacerts”
Also, since I work with several versions I have also added it to: “C:\Program Files (x86)\Java\jre-1.8\lib\security\cacerts”.
and also to “C:\Program Files\Java\jdk-18.0.2.1\lib\security\cacerts”
Do you think I’m missing something, because I don’t have any other java versions installed on my machine that I know of.
Okey, I set the environment variable, but doesn’t work
[System.Environment]::SetEnvironmentVariable(“SONAR_SCANNER_OPTS”, “-Djavax.net.ssl.trustStore=\repositories\tls-mutual-nginx\cacerts -Djavax.net.ssl.trustStorePassword=changeit”) ← In windows PS