[release/5.0.1xx-preview3] Set up TLS 1.2 before calling dotnet-install for tests (#7068)
* Set TLS1.2 before running dotnet-install in tests The new powershell process overrides the setting that build.ps1 sets up. * Reduce logging verbosity
This commit is contained in:
parent
89b89d74b4
commit
f5e7d53b35
2 changed files with 11 additions and 7 deletions
|
@ -97,7 +97,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
{
|
{
|
||||||
var httpResponse = await httpClient.GetAsync(source);
|
var httpResponse = await httpClient.GetAsync(source);
|
||||||
|
|
||||||
Log.LogMessage(MessageImportance.High, $"{source} -> {httpResponse.StatusCode}");
|
Log.LogMessage(MessageImportance.Normal, $"{source} -> {httpResponse.StatusCode}");
|
||||||
|
|
||||||
// The Azure Storage REST API returns '400 - Bad Request' in some cases
|
// The Azure Storage REST API returns '400 - Bad Request' in some cases
|
||||||
// where the resource is not found on the storage.
|
// where the resource is not found on the storage.
|
||||||
|
@ -116,7 +116,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
await httpResponse.Content.CopyToAsync(outStream);
|
await httpResponse.Content.CopyToAsync(outStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.LogMessage(MessageImportance.High, $"returning true {source} -> {httpResponse.StatusCode}");
|
Log.LogMessage(MessageImportance.Normal, $"returning true {source} -> {httpResponse.StatusCode}");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -120,16 +120,20 @@
|
||||||
<RuntimeTargetDirectory>$(DotnetToTestPath)shared\Microsoft.NETCore.App\$(RuntimeVersionToInstall)</RuntimeTargetDirectory>
|
<RuntimeTargetDirectory>$(DotnetToTestPath)shared\Microsoft.NETCore.App\$(RuntimeVersionToInstall)</RuntimeTargetDirectory>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
|
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
|
||||||
<InstallRuntimeCommand>powershell -NoLogo -NoProfile -ExecutionPolicy ByPass</InstallRuntimeCommand>
|
<!-- Set TLS1.2 explicitly before running this. If TLS1.2 isnt' enbabled by default this command may fail in some
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) "$(_DotNetRoot)dotnet-install.ps1"</InstallRuntimeCommand>
|
scenarios. Waiting on a fix to dotnet-install.ps1 to fix this in the right place. -->
|
||||||
|
<InstallRuntimeCommand>powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& {</InstallRuntimeCommand>
|
||||||
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) [Net.ServicePointManager]::SecurityProtocol = 'Tls12, Tls13';</InstallRuntimeCommand>
|
||||||
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) & '$(DotNetRoot)dotnet-install.ps1'</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) -Version $(RuntimeVersionToInstall)</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) -Version $(RuntimeVersionToInstall)</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) -InstallDir $(DotnetToTestPath)</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) -InstallDir $(DotnetToTestPath)</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) -Runtime "dotnet"</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) -Runtime 'dotnet'</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand Condition="'$(Architecture)' != ''">$(InstallRuntimeCommand) -Architecture "$(Architecture)"</InstallRuntimeCommand>
|
<InstallRuntimeCommand Condition="'$(Architecture)' != ''">$(InstallRuntimeCommand) -Architecture '$(Architecture)'</InstallRuntimeCommand>
|
||||||
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) }"</InstallRuntimeCommand>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
|
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
|
||||||
<InstallRuntimeCommand>/bin/bash</InstallRuntimeCommand>
|
<InstallRuntimeCommand>/bin/bash</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) "$(_DotNetRoot)dotnet-install.sh"</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) "$(DotNetRoot)dotnet-install.sh"</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) --version $(RuntimeVersionToInstall)</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) --version $(RuntimeVersionToInstall)</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) --install-dir "$(DotnetToTestPath)"</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) --install-dir "$(DotnetToTestPath)"</InstallRuntimeCommand>
|
||||||
<InstallRuntimeCommand>$(InstallRuntimeCommand) --runtime "dotnet"</InstallRuntimeCommand>
|
<InstallRuntimeCommand>$(InstallRuntimeCommand) --runtime "dotnet"</InstallRuntimeCommand>
|
||||||
|
|
Loading…
Reference in a new issue