SonarScanner.MSBuild SSL/TLS

Recently the c build-wrapper bypass was removed causing us to have to use the build-wrapper for our builds. Prior to removal I used the sonar-scanner.bat, but when I put the path for the output directory I get the following error:

INFO: ------------------------------------------------------------------------
INFO: Total time: 24.394s
INFO: Final Memory: 42M/457M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Illegal char <:> at index 8: output=C:\Jenkins\workspace\NCITE.Test.174\output\/build-wrapper-dump.json
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

For some reason it does not like the colon and adds a forward slash before the json file.

So, I switched to attempting to use the SonarScanner.MSBuild. However, the problem is that we have to pass a punch of pki/truststore information in order for the build server to connect with the SonarQube server. My SONAR_SCANNER_OPTS looks like this:

-Xmx4096m\path\to\local.jks\path\to\certs.jks -Dhttp.proxyHost=ip -Dhttp.proxyPort=port -Dhttps.proxyHost=ip -Dhttps.proxyPort=port

I’m getting the following error:

SonarScanner for MSBuild 4.5
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\sonar-scanner-msbuild\SonarQube.Analysis.xml
Loading analysis properties from C:\sonar-scanner-msbuild\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
17:42:21.003  Updating build integration targets...
17:42:21.037  Fetching analysis configuration settings...
17:42:21.324  Failed to request and parse 'https://sonar.server/api/server/version': The request was aborted: Could not create SSL/TLS secure channel.

Unhandled Exception: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadString(Uri address)
   at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass15_0.<DownloadServerVersion>b__0()
   at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func`1 op, String url, Action`1 onError)
   at SonarScanner.MSBuild.PreProcessor.SonarWebService.DownloadServerVersion()
   at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetServerVersion()
   at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, String projectBranch)
   at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
   at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
   at SonarScanner.MSBuild.BootstrapperClass.PreProcess()
   at SonarScanner.MSBuild.BootstrapperClass.Execute()
   at SonarScanner.MSBuild.Program.Execute(String[] args, ILogger logger)
   at SonarScanner.MSBuild.Program.Main(String[] args)

We are at a loss as to what to do at this point.

SonarQube version:
SonarScanner.MSBuild version:
SonarScanner version:

I am bumping this because I see no way around the issues that I am having. I could really use help here. Thanks

Hello @gbishop,

in the end, did you manage to analyze your project?

No, we’ve shelved analysis for that project for a bit. We’ll be returning to this in the near future though.

Hi @gbishop,

sad to hear that and glad to know you will look at it in the near future.