Unable to connect Sonarqube with Internal Gitlab server

Hello, im trying to connect Sonarqube with a an internal gitlab server via ALM integrations(developers edition), but i get the following error

Gitlab API call to [https:/myinternalserver] 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

My sonarqube is running inside docker container.
I have already imported the server certificate in the Java cacerts but nothing changed.
Im wondering if the problem begins from the container.
Could you please help me to solve this issue?

Hi, you need to double-check that your Gitlab SSL certificate contains exactly the full domain in the subject alternative name field. Wildcards are not supported.

Hi, thanks for the instant response. The subject alternative name field contains the full domain.
I believe that the problem has to do with the cacerts in the docker embedded Java 11.But i’m not sure about that.
Any suggestion?

Hi, with the correct SAN extension and the certificate in the jvm keystore, you should be good. How did you proceed to add the certificate to the jvm keystore?

Well, i haven’t added it yet because im not so familiar with dockers.
I haven’t figured it out how to add the certificate to the docker jvm keystore.

You can mount the keystore using volume mounts and the docker run command to use it for this issue is:

docker run -d -p 9000:9000 --name sonarqube-test -v /path/to/keystore:/opt/java/openjdk/lib/security/cacerts:ro sonarqube:8.8-community

That works perfectly fine.
Thanks a lot @pierreguillot

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.