For me, adding [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 solved, which is strange to me since this is an hosted pipeline, ran within a Linux vm.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12