Azure Pipepline with task Sonarqube https

天大地大妈咪最大 提交于 2019-12-11 14:59:48

问题


I added a Sonarqube task into my azure build pipeline, in order to login to my sonarqube server I need to run a command, which uses trunst store ssl.

my pipeline looks just like this:

- task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare@4
  displayName: 'Prepare analysis on SonarQube'
  inputs:
    SonarQube: abc-sonarqube
    scannerMode: CLI
    configMode: manual
    cliProjectKey: 'abc'
    cliProjectName: 'abc'
    cliSources: src
    extraProperties: |
      sonar.host.url=https://sonarqube.build.abcdef.com
      sonar.ce.javaAdditionalOpts=-Djavax.net.ssl.trustStore=mvn/sonar.truststore -Djavax.net.ssl.trustStorePassword=changeit

I am not sure, if this command "sonar.ce.javaAdditionalOpts=-Djavax.net.ssl.trustStore=mvn/sonar.truststore -Djavax.net.ssl.trustStorePassword=changeit" correct is.

I got the error "API GET '/api/server/version' failed, error was: {"code":"UNABLE_TO_VERIFY_LEAF_SIGNATURE"} "

PS: my project is angular project.

any solutions?


回答1:


Azure Pipepline with task Sonarqube https

This issue should be related in how the configure task works. So, even if we add the certificate to the java trustore, the task that sets the configuration uses a different runtime (not java at least) to communicate with the server, that’s why you still get that certificate error.

To resolve this issue, you could try to:

set a global variable, NODE_EXTRA_CA_CERTS, and set it to a copy of the root cert we had stored locally in a directory. See this article.

Check the related ticket for some more details.

Hope this helps.



来源:https://stackoverflow.com/questions/58542439/azure-pipepline-with-task-sonarqube-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!