SonarQube not Connecting to a self-signed certificate GitLab server

Hi,

I’m using SonarQube 9.3 on RHEL 7. We have a GitLab server, version 13.11.4. I am trying to configure the GitLab server so that SonarQube can work with it.

The GitLab server has a self signed certificate.

I’m using the appropriate url: https://[server name and domain]/api/v4

However, when I put in the url and try to register it. I get the following error: Could not validate GitLab url. Got an unexpected answer.

If I use the url with a browser, I get a “404 not found” error.

Any ideas on what can be causing my issue? Is it that GitLab is not working properly? Or could it be the self-signed certificate?

Thanks in advance

Scott

Hey there.

You should be able to check the web.log of your instance for an error message (it may help to turn the logging in global Administration > System > Log Level up to DEBUG) and trying to validate your configuration once more.

If you see an error like PKIX path building failed – it is definitely the result of using a self-signed certificate. Often, when a self-signed certificate is used, the truststore that Java uses (which runs your SonarQube instance) can’t trust that certificate. Adjusting the truststore to add the certificate and restarting your SonarQube server will resolve the issue.

You may see another error like Hostname not verified which requires other actions.

In any case – start looking at the logs and see what they tell you :+1:

Awesome. I’ll let you know what I find.

Thanks,

Scott

It looks like the SubjectAlternativeName problem is the cause. Working to correct it with the person whom made the certificate.

Thanks,

Scott

1 Like

That worked. Now, I get a new error. PKIX path building failed: sun…SunCertPathBuilderException: unable to find valid certification path to requested target

So, I just wanted to update on what seemed to have fixed the problem. I updated all the keystores in all locations where I found the cacert file that was located in a java related directory. Then I ended up rebooting the machine and everything was working when it came back up. I’m not sure the reboot was required. I rebooted for another reason, but that was the steps I took to resolve the problem.

Thanks for the help Colin.

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