Hi,
we are using the following versions:
-
SonarQube Community: v10.6.92116
-
GitLab Free: v17.1
SonarQube is deployed via zip on a windows server and GitLab is self-hosted and using a self-signed certificate.
What I’m trying to do
I’m trying to add the GitLab DevOps Platform Integration into our SonarQube.
Related logs
And I get the following log Error in web.log:
2024.07.02 12:04:57 INFO web[][o.s.a.c.g.GitlabApplicationClient] Gitlab API call to [https://gitlab.example.com/api/v4/projects] failed with error message : [PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I have attempted to import the certificate into the Java trust store and now I get this log when SonarQube starts in sonar.log: (DEBUG level enabled)
2024.07.02 10:34:14 DEBUG app[][jdk.event.security] X509Certificate: Alg:SHA256withRSA, Serial:45cd46d7c2e767f31a591d77f9599e2e, Subject:CN=gitlab.example.com, O=Org, L=Brno, ST=CR, C=CZ, Issuer:C=SK, O="Example Organization", CN=Example CA, Key type:RSA, Length:2048, Cert Id:1047345666, Valid from:03.03.23 15:22, Valid until:03.03.25 16:22
From this log I assume that the certificate has beed successfully imported into the Java runtime.
Here are some similar issues that did not help solve my problem:
1. Self signed certificate SonarScanner #18973
In this issue the log is different and the Subject Alt Names is actually defined correctly in our certificate.
Subject Alt Names
DNS Name gitlab
DNS Name gitlab.example.com
2. SonarQube not Connecting to a self-signed certificate GitLab server #58023
Based on the log from sonar.log the certificate is actually imported into JRE so the solution that helped there does not seem to work for me, unless I’m wrong about the fact that the CA certificate is imported into the JRE.
Any ideas on how to fix this?
Thanks ahead,
Ondrej