git - sonarqube - 添加自签名证书以连接 git
问题描述
我有自签名证书来连接到 azure devops server 2019。我已经在 git root 证书中注册了自签名证书。现在,我想配置 sonarqube 在自托管代理上使用自签名证书。我尝试在服务器和自托管代理上使用 keytool 在 java 的密钥库中注册证书。但到目前为止还没有成功。
下面是Log sonar Prepare分析
##[section]Starting: Prepare analysis on SonarQube
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarQube analysis configuration
Version : 4.8.0
Author : sonarsource
Help : [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
SYSTEMVSSCONNECTION exists true
##[warning]Unable to get default branch, defaulting to 'master': Error: unable to get local issuer certificate
[command]D:\Agent-Pools\sonaragent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.8.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:devops-dashboard-core
SonarScanner for MSBuild 4.7.1
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
22:37:00.721 Updating build integration targets...
22:37:00.808 Fetching analysis configuration settings...
22:37:02.839 Provisioning analyzer assemblies for cs...
22:37:02.84 Installing required Roslyn analyzers...
22:37:03.386 Provisioning analyzer assemblies for vbnet...
22:37:03.386 Installing required Roslyn analyzers...
22:37:03.439 Pre-processing succeeded.
##[section]Finishing: Prepare analysis on SonarQube
解决方案
If you have added the certificate to the agent, then you can set the NODE_EXTRA_CA_CERTS variable to point to your ca cert or cert.
In my case I added the environment variable and set the value to the ca certificate used for signing the certificate.
- name: NODE_EXTRA_CA_CERTS
value: /etc/ssl/certs/ca-certificates.crt
Credit goes to Chris Hardie: https://community.sonarsource.com/t/tfs-buid-server-cannot-connect-to-teh-sonarqube-server-over-ssl/1194/3
More information regarding the NODE_EXTRA_CA_CERTS here: https://groups.google.com/forum/#!msg/sonarqube/1W8raF6ZMVM/iFgQhVENAAAJ
推荐阅读
- reactjs - 即使依赖值未更改,在重新渲染时也会调用 useEffect 的无限循环
- php - “parent::__construct($model)”的功能是什么?
- python - 在 NodeJs 中创建具有固定大小数组的 C 结构
- html - 我如何在不拉伸或裁剪的情况下更改任何图像的宽度和高度值
- python - 用一个 str 列和一个 int 列创建一个 np 数组
- algorithm - 根据优先级编号从唯一玩家列表中生成一个团队。3 不同角色的注册数组
- javascript - 如何从firestore文档中的密钥中获取值
- .net-core - 使用 IdentityServer4 和 Twitter 登录是否可以连接现有帐户?
- html - 让我的页面在刷新时显示在顶部
- php - 如何解释 at() 函数;substr() 函数;伪代码中的发生()函数