Must-share information (formatted with Markdown):
- which versions are you using: 9.6
- what are you trying to achieve: use Python api to retrieve metrics
- what have you tried so far to achieve this: just trying to authenticate with username/pw and url.
I create a SonarQubeClient() with url, username, password, and cert (.pem). Then I try any api request and get the following error: Max retries exceeded with url: /sonar/api/server/version (caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certification verify failed: unable to get local issuer certificate (_ssl.c:1129)’)))
The basics of the code is this:
URL = 'https://company.name.com/sonar'
USERNAME = 'admin'
PASSWORD = 'admin'
CERT = 'company.name.com.pem'
cert_path = Path(CERT)
if cert_path.is_file():
sonar = SonarQubeClient(sonarqube_url=URL, username=USERNAME, password=PASSWORD, cert=CERT)
version = sonar.server.get_server_version()
print(version)
The code doesn’t work but a curl command does:
curl --cacert company.name.com.pem -X GET https://company.name.com/sonar/api/server/version