Reputation: 17
I am trying to run a test file for my Web APIs using .http
files.
However, whenever I attempt to load the file in Visual Studio 2022 in the output box I get the following:
Executing command 'dotnet tool install Microsoft.dotnet-interactive --version 1.0.506904 --configfile NuGet.config'.
It fails with an SSL exception.
Command 'dotnet tool install Microsoft.dotnet-interactive --version 1.0.506904 --configfile NuGet.config' failed with exit code '1':
Unhandled exception: NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json.
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: PartialChain
at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at NuGet.Protocol.ServerWarningLogHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at NuGet.Protocol.ProxyAuthenticationHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at NuGet.Protocol.HttpSourceAuthenticationHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at NuGet.Protocol.HttpRetryHandler.<>c__DisplayClass5_1.<<SendAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at NuGet.Protocol.TimeoutUtility.StartWithTimeout[T](Func
2 getTask, TimeSpan timeout, String timeoutMessage, CancellationToken token)
at NuGet.Protocol.HttpRetryHandler.SendAsync(HttpRetryHandlerRequest request, String source, ILogger log, CancellationToken cancellationToken)
at NuGet.Protocol.HttpSource.GetThrottledResponse(Func1 requestFactory, TimeSpan requestTimeout, TimeSpan downloadTimeout, Int32 maxTries, Boolean isRetry, Boolean isLastAttempt, Guid sessionId, ILogger log, CancellationToken cancellationToken) at NuGet.Protocol.HttpSource.<>c__DisplayClass15_0
1.<b__0>d.MoveNext() --- End of stack trace from previous location --- at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func2 action, CancellationToken token) at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func
2 action, CancellationToken token) at NuGet.Protocol.HttpSource.GetAsync[T](HttpSourceCachedRequest request, Func2 processAsync, ILogger log, CancellationToken token) at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token) --- End of inner exception stack trace --- at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token) at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token) at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token) at NuGet.Protocol.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token) at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token) at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetPackageMetadataAsync(PackageSource source, String packageIdentifier, Boolean includePrerelease, Boolean includeUnlisted, CancellationToken cancellationToken) at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetPackageMetadataAsync(String packageIdentifier, NuGetVersion packageVersion, IEnumerable
1 sources, CancellationToken cancellationToken, Boolean includeUnlisted) at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetPackageSourceAndVersion(PackageId packageId, NuGetVersion packageVersion, PackageSourceLocation packageSourceLocation, Boolean includePreview, Boolean includeUnlisted, PackageSourceMapping packageSourceMapping) at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.DownloadPackageAsync(PackageId packageId, NuGetVersion packageVersion, PackageSourceLocation packageSourceLocation, Boolean includePreview, Boolean includeUnlisted, Nullable1 downloadFolder, PackageSourceMapping packageSourceMapping) at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.DownloadAndExtractPackage(PackageLocation packageLocation, PackageId packageId, INuGetPackageDownloader nugetPackageDownloader, String packagesRootPath, IToolPackageStore toolPackageStore, NuGetVersion packageVersion, PackageSourceLocation packageSourceLocation, Boolean includeUnlisted) at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0() at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func
1 action, Action commit, Action rollback) at Microsoft.DotNet.Tools.Tool.Install.ToolInstallLocalInstaller.Install(FilePath manifestFile) at Microsoft.DotNet.Tools.Tool.Install.ToolInstallLocalCommand.InstallNewTool(FilePath manifestFile) at Microsoft.DotNet.Tools.Tool.Install.ToolInstallLocalCommand.Execute() at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
As a test, I have attempted to do things like disabling the SSL (dangerous - I know!).
Is there anything else I could do to fix this? Or is there a workaround to run the `.http` tests in a different way?
**TLDR;**
Trying to run `.http` test files for my Web API in Visual Studio 2022 <- main issue to resolve
Getting issues with the microsoft.dotnet-interactive installation.
SSL issues with https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
Attempt things like disabling SSL in nuget config.
Upvotes: 0
Views: 158
Reputation: 2125
I encountered this issue in Visual Studio 2022 and figured out that one of my custom Nuget sources, a local directory for my own nuget publishing, was not meeting the security threshold needed. This is just a folder on my machine so this seems like a bug.
To fix the issue, I went into Tools/Options, unchecked that Package Source checkbox, and restarted VS and it worked from there.
Upvotes: 0