Certificate error when running SonarQubePrepare in azure devops

We have a number of sonarqube projects that use azure devops and the SonarQubePrepare step. Most of these work fine.
However I added a new project, generated a project key and re-used an existing working service connection, but the pipeline fails with this error:

##[error][ERROR] SonarQube Server: Error while executing task Prepare: API GET '/api/server/version' failed. Error message: unable to get local issuer certificate.
##[error]API GET '/api/server/version' failed. Error message: unable to get local issuer certificate.

Anyone have any ideas? Its strange that this new project fails when all others are working

Hi,

Welcome to the community!

To confirm, you’re using an exact copy of a working pipeline, with just things like the project key & name changed?

Is this project’s job running on a build agent that hasn’t handled analysis before?

To be clear, this is an SSL error that has to do with the JRE analysis is running with not trusting your (self-signed?) certificates. Have you explicitly provided Java on your build agents, or are you allowing the scanner to provide its own version? If the former, here are the docs on setting up analysis with the certificate.

 
HTH,
Ann