tag:help.appveyor.com,2012-11-13:/discussions/problems/28684-nuget-ssltls-error-after-upgrading-from-vs2015-to-vs2019AppVeyor: Discussion 2021-05-28T11:00:19Ztag:help.appveyor.com,2012-11-13:Comment/488858562020-12-07T18:49:29Z2020-12-07T18:49:32ZNuGet SSL/TLS error after upgrading from VS2015 to VS2019<div><p>I'm modernizing a legacy project that was still being built using the "Visual Studio 2015" image. I changed that to "Visual Studio 2019" and now my build fails. It seems it can't restore any NuGet package:</p>
<p>"<a href="https://api.nuget.org/v3/index.json">https://api.nuget.org/v3/index.json</a>: Unable to load the service index for source <a href="https://api.nuget.org/v3/index.json">https://api.nuget.org/v3/index.json</a>. An error occurred while sending the request. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure."</p>
<p>If I rebuild a previous commit (which uses VS2015), I see it uses the NuGet v2 feed and these do succeed.</p>
<p>When I build locally on my machine, my VS2019 uses the v3 feed too, and without errors.</p>
<p>I've Googled around, but can't seem to find any others who have this issue recently.</p></div>peter.morliontag:help.appveyor.com,2012-11-13:Comment/488858562020-12-07T18:55:10Z2020-12-07T18:55:10ZNuGet SSL/TLS error after upgrading from VS2015 to VS2019<div><p>Hi Peter,</p>
<p>Last year there was a fix for failing NuGet. You might still have it in your build configuration, something like:</p>
<pre>
<code>[System.IO.File]::AppendAllText("C:\Windows\System32\drivers\etc\hosts", "`n93.184.221.200`tapi.nuget.org")</code>
</pre>
<p>This fix is not needed anymore.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/488858562020-12-08T10:01:37Z2020-12-08T10:01:37ZNuGet SSL/TLS error after upgrading from VS2015 to VS2019<div><p>That seems to be it, thanks.</p></div>peter.morlion