Closed mayconbeserra closed 2 years ago
Hi @mayconbeserra
Since version 5.3.2 we have support the following parameters to specify a client cert:
/d:sonar.clientcert.path=They are documented here. The password must be specified in the begin and end step.
If you add these, does that resolve your issue?
Tom
thanks for your reply, @tom-howlett-sonarsource
Our server doesn't require a client certificate.
Our website (sonarqube) is protected by TLS Certificate (https), and that TLS certificate is self-signed by our corporation and CA authority.
If you see the logs, you can see sonarqube can access and call our sonarqube, However, it cannot finish the end method.
My question is - why do some calls to our sonarqube work, and some of them does not?
Hi @mayconbeserra
It looks like this is related to the Java part of the Scanner that the Scanner for .NET wraps. I'm going to close this issue. Can you please re-raise it on the community forum. Apologies we couldn't resolve it here.
Tom
Description
Error while sending the sonar analysis to Sonarqube server that uses a self-signed certificate.
The server is properly set up and the CA Certificate is installed correctly in the container.
The container can call sonarqube without issues and can also download the analyzers.
However, it cannot send the analysis in the last step.
Repro steps
Please provide the steps required to reproduce the problem
Create a docker image with .NET Core 6 and Java OpenJDK11
Install cacertificates
perform a curl request to check if the server validates correctly the certificate
dotnet new console
export SONAR_SCANNER_OPTS="-Djavax.net.ssl.trustStore=/usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.debug=ssl:handshake"
**JAVA_HOME can be different based on your installation
dotnet sonarscanner begin /k:"project-key" /d:sonar.login="1bcbe8d78d4fbc333b58ae" /d:"sonar.host.url=https://mycompanysonarserver"
dotnet build
dotnet sonarscanner end /d:sonar.login="afb0f719bb73647dba6443c7da78be76ad29011e"
If possible then please create a git repository with a repro sample or attach a zip to the issue.
Expected behavior
The expected behaviour is the analysis to be send to Sonarqube.
Sonar can download the analyses and do some additional operations against the sonarqube server. However, it cannot send the data at the final step due a certificate issue.
The result should be consistent like in other steps.
Actual behavior
INFO: EXECUTION FAILURE.
Logs
List certificates in KeyStore
Can the JavaIOException below be the problem?
keytool -list -v -keystore $JAVA_HOME/lib/security/cacerts
Related information