MSBuild 的 SonarQube 服务器信任问题
SonarQube Server trust issue with MSBuild
我想 运行 对 .NET
项目进行 SonarQube 分析。
我已经设置了一个 docker 图像,其先决条件描述为 here。
按照说明操作时:
mono /msbuild/SonarQube.Scanner.MSBuild.exe begin /d:sonar.login=<my-sonarqube-secret-token> /k:somenameipasshere
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at /msbuild/SonarQube.Analysis.xml
Loading analysis properties from /msbuild/SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
16:49:01.29 Updating build integration targets...
16:49:01.305 Fetching analysis configuration settings...
16:49:01.433 Failed to request and parse 'https://myserver.sonarqube.local/api/server/version': Error: TrustFailure (One or more errors occurred.)
16:49:01.433 A server certificate could not be validated. Possible cause: you are using a self-signed SSL certificate but the certificate has not been installed on the client machine. Please make sure that you can access https://myserver.sonarqube.local without encountering certificate errors.
16:49:01.434 Pre-processing failed. Exit code: 1
...但是
# keytool -import -file /sonar-scanner/certs/myserver.sonarqube.local.crt -keystore /sonar-scanner/jre/lib/security/cacerts -alias myserver.sonarqube.local -storepass <somepass> -noprompt
keytool error: java.lang.Exception: Certificate not imported, alias <myserver.sonarqube.local> already exists
显然,MSBuild 扫描器无法像 sonar-scanner
那样使用 keytool
。
必须完成将服务器使用的 CA 证书复制到 /usr/local/share/ca-certificates/
和 运行 sudo update-ca-certificates
.[=14 的典型 (debian/ubuntu) 过程=]
然后可以与 SonarQube 服务器进行安全通信。
我想 运行 对 .NET
项目进行 SonarQube 分析。
我已经设置了一个 docker 图像,其先决条件描述为 here。
按照说明操作时:
mono /msbuild/SonarQube.Scanner.MSBuild.exe begin /d:sonar.login=<my-sonarqube-secret-token> /k:somenameipasshere
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at /msbuild/SonarQube.Analysis.xml
Loading analysis properties from /msbuild/SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
16:49:01.29 Updating build integration targets...
16:49:01.305 Fetching analysis configuration settings...
16:49:01.433 Failed to request and parse 'https://myserver.sonarqube.local/api/server/version': Error: TrustFailure (One or more errors occurred.)
16:49:01.433 A server certificate could not be validated. Possible cause: you are using a self-signed SSL certificate but the certificate has not been installed on the client machine. Please make sure that you can access https://myserver.sonarqube.local without encountering certificate errors.
16:49:01.434 Pre-processing failed. Exit code: 1
...但是
# keytool -import -file /sonar-scanner/certs/myserver.sonarqube.local.crt -keystore /sonar-scanner/jre/lib/security/cacerts -alias myserver.sonarqube.local -storepass <somepass> -noprompt
keytool error: java.lang.Exception: Certificate not imported, alias <myserver.sonarqube.local> already exists
显然,MSBuild 扫描器无法像 sonar-scanner
那样使用 keytool
。
必须完成将服务器使用的 CA 证书复制到 /usr/local/share/ca-certificates/
和 运行 sudo update-ca-certificates
.[=14 的典型 (debian/ubuntu) 过程=]
然后可以与 SonarQube 服务器进行安全通信。