chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.04k stars 890 forks source link

sslProtocol type has invalid value #3470

Open JanHergenhan opened 1 week ago

JanHergenhan commented 1 week ago

Checklist

What You Are Seeing?

choco upgrade resets the security protocol although the command [System.Net.ServicePointManager]::SecurityProtocol shows that it's already SystemDefault. Then the connection to get the service index fails: Der angegebene Wert ist in der Enumeration SslProtocolType ungültig. (specified value in Enum SslProtocolType is invalid, sorry for the German console, cannot change it...).

Executing the command with the --debug option reveals Unable to connect to source 'https://chocolatey.org/api/v2/': System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. bei chocolatey.infrastructure.app.nuget.NugetList.<>c__DisplayClass20_1.<FindPackage>b__2() bei chocolatey.infrastructure.tolerance.FaultTolerance.TryCatchWithLoggingException[T](Func1 function, String errorMessage, Boolean throwError, Boolean logWarningInsteadOfError, Boolean logDebugInsteadOfError, Boolean isSilent)`

image

What is Expected?

I'd expect that the connection is established. Had no issues in several years using chocolatey...

How Did You Get This To Happen?

  1. I ran choco upgrade all or choco upgrade (some package)
  2. no package was upgraded...
  3. not sure if there was a windows update since the last successful execution of choco upgrade

System Details

Installed Packages

autohotkey 1.1.37.1
autohotkey.install 1.1.37.1
awscli 2.16.10
chocolatey 2.3.0
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-windowsupdate.extension 1.0.5
Cmder 1.3.25
DotNet3.5 3.5.20160716
DotNet4.5.2 4.5.2.20140902
dotnet-6.0-desktopruntime 6.0.31
dotnet-6.0-sdk-4xx 6.0.423
dotnetcore-3.1-sdk 3.1.426
dotnetcore-3.1-sdk-4xx 3.1.426
fiddler 5.0.20243.10853
gimp 2.10.38
git 2.45.2
git.install 2.45.2
gitextensions 4.2.1
InkScape 1.3.2
k9s 0.32.5
KB2533623 2.0.0
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
KB3063858 1.0.0
kubernetes-cli 1.30.2
nodejs-lts 20.14.0
notepadplusplus 8.6.8
notepadplusplus.install 8.6.8
NSwagStudio 14.0.8
NugetPackageExplorer 6.0.64
OpenSSL.Light 3.1.4
p4merge 2024.2.0
pgadmin4 8.8.0
postman 11.1.0
python 3.12.4
python3 3.12.4
python311 3.11.9
python312 3.12.4
saml2aws 2.36.16
soapui 5.7.2
terraform 1.5.7
vcredist140 14.40.33810
vcredist2010 10.0.40219.32503
vcredist2015 14.0.24215.20170201
vcredist2017 14.16.27033
vscode 1.90.1
vscode.install 1.90.1
windirstat 1.1.2.20161210
winmerge 2.16.40

Output Log

PS C:\WINDOWS\system32> choco upgrade k9s --debug --verbose
Chocolatey v2.3.0
Chocolatey is running on Windows v 10.0.19045.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" upgrade k9s --debug --verbose
Received arguments: upgrade k9s --debug --verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
SecurityProtocol was set to Ssl3, Tls, resetting to SystemDefault.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
Performing validation checks.
Global Configuration Validation Checks:
 - Package Exit Code / Exit On Reboot = Checked
System State Validation Checks:
 Reboot Requirement Checks:
 - Pending Computer Rename = Checked
 - Pending Component Based Servicing = Checked
 - Pending Windows Auto Update = Checked
 - Pending File Rename Operations = Checked
 - Pending Windows Package Installer = Checked
 - Pending Windows Package Installer SysWow64 = Checked
Cache Folder Lockdown Checks:
 - Elevated State = Checked
 - Folder Exists = Checked
 - Folder lockdown = Checked
The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: CommandName='upgrade'|
CacheLocation='C:\Users\#####\AppData\Local\Temp\chocolatey'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
IncludeConfiguredSources='False'|ShowOnlineHelp='False'|Debug='True'|
Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='True'|
DisableCompatibilityChecks='False'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='k9s'|AllVersions='False'|
SkipPackageInstallProvider='False'|SkipHookScripts='False'|
PackageNames='k9s'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
CacheExpirationInMinutes='30'|AllowDowngrade='False'|
ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.19045.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='2.3.0.0'|
Information.ChocolateyProductVersion='2.3.0'|
Information.FullName='choco, Version=2.3.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='#####'|
Information.UserDomainName='#######'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|
Information.IsLicensedAssemblyLoaded='False'|
Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\WINDOWS\system32'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
Features.UsePackageHashValidation='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
ListCommand.ExplicitPageSize='False'|
ListCommand.ExplicitSource='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
UpgradeCommand.IgnorePinned='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='Unknown'|
ApiKeyCommand.Command='Unknown'|PinCommand.Command='Unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|CacheCommand.Command='Unknown'|
CacheCommand.RemoveExpiredItemsOnly='False'|
_ Chocolatey:ChocolateyUpgradeCommand - Normal Run Mode _
Upgrading the following packages:
k9s
By upgrading, you accept licenses for the packages.
Running list with the following filter = ''
--- Start of List ---
Resolving resource PackageSearchResource for source C:\ProgramData\chocolatey\lib
autohotkey 1.1.37.1
autohotkey.install 1.1.37.1
awscli 2.16.10
chocolatey 2.3.0
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-windowsupdate.extension 1.0.5
Cmder 1.3.25
DotNet3.5 3.5.20160716
DotNet4.5.2 4.5.2.20140902
dotnet-6.0-desktopruntime 6.0.31
dotnet-6.0-sdk-4xx 6.0.423
dotnetcore-3.1-sdk 3.1.426
dotnetcore-3.1-sdk-4xx 3.1.426
fiddler 5.0.20243.10853
gimp 2.10.38
git 2.45.2
git.install 2.45.2
gitextensions 4.2.1
InkScape 1.3.2
k9s 0.32.5
KB2533623 2.0.0
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
KB3063858 1.0.0
kubernetes-cli 1.30.2
nodejs-lts 20.14.0
notepadplusplus 8.6.8
notepadplusplus.install 8.6.8
NSwagStudio 14.0.8
NugetPackageExplorer 6.0.64
OpenSSL.Light 3.1.4
p4merge 2024.2.0
pgadmin4 8.8.0
postman 11.1.0
python 3.12.4
python3 3.12.4
python311 3.11.9
python312 3.12.4
saml2aws 2.36.16
soapui 5.7.2
terraform 1.5.7
vcredist140 14.40.33810
vcredist2010 10.0.40219.32503
vcredist2015 14.0.24215.20170201
vcredist2017 14.16.27033
vscode 1.90.1
vscode.install 1.90.1
windirstat 1.1.2.20161210
winmerge 2.16.40
--- End of List ---
Resolving resource ListResource for source https://chocolatey.org/api/v2/
Unable to load the service index for source https://chocolatey.org/api/v2/.
Fehler beim Senden der Anforderung.
Die zugrunde liegende Verbindung wurde geschlossen: Unbekannter Fehler beim Empfangen..
Der angegebene Wert ist in der Enumeration SslProtocolType ungültig.
Parametername: sslProtocolType
For more information on this issue and guidance in resolving the problem, see https://ch0.co/t/svcidx
Resolving resource PackageMetadataResource for source https://chocolatey.org/api/v2/
Unable to connect to source 'https://chocolatey.org/api/v2/':
 System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei chocolatey.infrastructure.app.nuget.NugetList.<>c__DisplayClass20_1.<FindPackage>b__2()
   bei chocolatey.infrastructure.tolerance.FaultTolerance.TryCatchWithLoggingException[T](Func`1 function, String errorMessage, Boolean throwError, Boolean logWarningInsteadOfError, Boolean logDebugInsteadOfError, Boolean isSilent)

Additional Context

No response

pauby commented 1 week ago

For anybody else reading it, the translation of the error is:

--- End of List ---
Resolving resource ListResource for source https://chocolatey.org/api/v2/
Unable to load the service index for source https://chocolatey.org/api/v2/.
Error sending request.
The underlying connection was closed: Unknown error while receiving..
The specified value is invalid in the SslProtocolType enumeration.
Parameter name: sslProtocolType
For more information on this issue and guidance in resolving the problem, see https://ch0.co/t/svcidx
Resolving resource PackageMetadataResource for source https://chocolatey.org/api/v2/
Unable to connect to source 'https://chocolatey.org/api/v2/':
System.NullReferenceException: The object reference was not set to an object instance.
  at chocolatey.infrastructure.app.nuget.NugetList.<>c__DisplayClass20_1.<FindPackage>b__2()
  at chocolatey.infrastructure.tolerance.FaultTolerance.TryCatchWithLoggingException[T](Func`1 function, String errorMessage, Boolean throwError, Boolean logWarningInsteadOfError, Boolean logDebugInsteadOfError, Boolean isSilent)
pauby commented 1 week ago

@JanHergenhan What is the output from [Enum]::GetNames([Net.SecurityProtocolType])?

JanHergenhan commented 1 week ago

@pauby the response is

SystemDefault
Ssl3
Tls
Tls11
Tls12
Tls13
pauby commented 1 week ago

Then I'm unsure what the problem is with that value.

~I feel our logging should really say "The specified value is invalid in the SslProtocolType enumeration."~

I don't think is related to your issue, as this is a warning, not a terminating error: SecurityProtocol was set to Ssl3, Tls, resetting to SystemDefault..

Have you looked at https://ch0.co/t/svcidx as recommended in the output?

JanHergenhan commented 1 day ago

Sorry, @pauby , I didn't notice the update in your answer. I had looked at that page and also tried the recommended IISCrpypto tool. As strage as it may seem, I got it working once after setting the best practices config. However, since then I'm back to the described issue.

pauby commented 20 hours ago

At this stage, I think what we have left is trying the normal troubleshooting methods:

I'm unsure if the SSL issue is related to you not being able to connect, but we have not had any issue raised about this before. I am as certain as I can be that this is an environmental issue and not a Chocolatey CLI one.