clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
426 stars 39 forks source link

.NET dependency retrieval fails #199

Closed fasigno closed 9 months ago

fasigno commented 9 months ago

Hi, I want to report that the autonomous retrieval of .NET 6.0 dependency fails during app installation.

From logs:

2024-01-10 12:23:04.1461 [INFO] - WindowBase: User prompted: 'requires .NET 6.0.2 WindowsDesktop (x64) installed to continue, would you like to install it now?' -- User answered OK
2024-01-10 12:23:05.7298 [FATAL] - Program: Encountered fatal unhandled exception.: System.AggregateException: One or more errors occurred. (Dotnet version '6.0' (WindowsDesktop) was not found online or could not be retrieved.)
 ---> System.Exception: Dotnet version '6.0' (WindowsDesktop) was not found online or could not be retrieved.
 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
   at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken , ExceptionDispatchInfo )
   at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions )
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter , Boolean , Byte[] , Boolean )
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions , HttpRequestMessage , Boolean , Stream , CancellationToken )
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions , HttpRequestMessage , Boolean , Stream , CancellationToken )
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage )
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken )
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage , Boolean , Boolean , CancellationToken )
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage , CancellationToken )
   at Squirrel.Sources.HttpClientFileDownloader.DownloadString(String url, String authorization, String accept) in ./Sources/HttpClientFileDownloader.cs:line 59
   at Squirrel.Runtimes.DotnetInfo.GetLatestDotNetVersion(DotnetRuntimeType runtimeType, String channel, IFileDownloader downloader) in ./RuntimeInfo.cs:line 397
   --- End of inner exception stack trace ---
   at Squirrel.Runtimes.DotnetInfo.GetLatestDotNetVersion(DotnetRuntimeType runtimeType, String channel, IFileDownloader downloader) in ./RuntimeInfo.cs:line 399
   at Squirrel.Runtimes.DotnetInfo.GetDownloadUrl() in ./RuntimeInfo.cs:line 282
   at Squirrel.Runtimes.RuntimeInfo.DownloadToFile(String localPath, Action`1 progress, IFileDownloader downloader) in ./RuntimeInfo.cs:line 72
   at Squirrel.Update.Program.Setup(String setupPath, Boolean silentInstall, Boolean checkInstall) in ./Program.cs:line 207
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean )
   at System.Threading.Tasks.Task.Wait(Int32 , CancellationToken )
   at System.Threading.Tasks.Task.Wait()
   at Squirrel.Update.Program.executeCommandLine(String[] args) in ./Program.cs:line 85
caesay commented 9 months ago

This is an issue with the computer you are running on. As you can see from the stack trace, the error is:

The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

This means the SSL certificate that Microsoft is using is not trusted by your operating system. This should not be the case unless it's an old / unsupported operating system or it has not been updated.

fasigno commented 9 months ago

I knew it could be an issue by my side but I was trying installation process through Windows 10 sandbox and I thought it would had inherited the certificates from normal session. I also tryed on an old windows 10 1809 virtual machine and giving me the same alert I decided to open an issue. Probably not the best environment to try on!