Azure devops (TFS) on prem download .net core SKD fails with self signed certificate in certificate chain

Viewed 27

I am using azure devops on prem (previously called TFS). And I have a problem with build agent. When the agent is trying to download the latest microsoft .net core SDK it fails with self signed certificate in certificate chain error.

Here is the full error:

Starting: Use version 6.0.x of nuget
==============================================================================
Task         : Use .NET Core
Description  : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version      : 2.184.0
Author       : Microsoft Corporation
Help         : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 6.0.x.
Found version 6.0.401 in channel 6.0 for user specified version spec: 6.0.x
Version 6.0.401 was not found in cache.
Getting URL to download .NET Core sdk version: 6.0.401.
Detecting OS platform to find correct download package for the OS.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'C:\AzureDevops\agent\_work\_tasks\UseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea6\2.184.0\externals\get-os-platform.ps1'"
Primary:win-x64
Detected platform (Primary): win-x64
Downloading: https://download.visualstudio.microsoft.com/download/pr/aa0b6cf3-c5dc-40ff-8b2f-f2970ca7b9e3/5b4a9999ea41ca5897e01a3e0e1accad/dotnet-sdk-6.0.401-win-x64.zip
##[error]Failed while installing version: 6.0.401 at path: C:\AzureDevops\agent\_work\_tool/dotnet with error: Could not download installation package from this URL: https://download.visualstudio.microsoft.com/download/pr/aa0b6cf3-c5dc-40ff-8b2f-f2970ca7b9e3/5b4a9999ea41ca5897e01a3e0e1accad/dotnet-sdk-6.0.401-win-x64.zip Error: Error: self signed certificate in certificate chain
Finishing: Use version 6.0.x of nuget

I had a look on agent code on github and I think problem is in this method: enter image description here

I coudn't dig deeper in the projec itself but I think it is using this azure-pipelines-tool-lib/tool But I coudn't find anything that would help me there either.

Any suggestions or configurations to check?

My workaround so far is to download the sdk manually and place it into cache folder (agent_work_tool\dotnet\sdk) of the agent, but I would have to do that every time microsoft releases new major version.

0 Answers
Related