Skip to content

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

Add a method to convert passwords to NetworkCredential using codepage 1252 encoding to support non-ASCII characters in credentials. This addresses issues with encoding mismatches in .NET 4.8.1 that cause incorrect password handling.

Update credential retrieval to use this conversion method, falling back to the original password on retry attempts to maintain compatibility.

Add tests verifying correct username and legacy-encoded password handling for non-ASCII characters in explicit and implicit credential scenarios.

Motivation and Context

Even when a user is using a password with non-ascii characters, we would still want the user to be able to connect to a remote source, even when

Testing

  1. Update the credentials used for one of your sources to include non-ascii characters (ie, øæåéèàù)
  2. Attempt to search for a package using the updated source with the new credentials.
  3. Verify the expected results are shown.

Operating Systems Testing

  • Windows 11

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Fixes #3600

…lback

Add a method to convert passwords to NetworkCredential using codepage 1252
encoding to support non-ASCII characters in credentials. This addresses issues
with encoding mismatches in .NET 4.8.1 that cause incorrect password handling.

Update credential retrieval to use this conversion method, falling back to the
original password on retry attempts to maintain compatibility.

Add tests verifying correct username and legacy-encoded password handling for
non-ASCII characters in explicit and implicit credential scenarios.
@AdmiringWorm AdmiringWorm self-assigned this Jul 21, 2025
@gep13 gep13 self-requested a review August 7, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chocolatey does not handle passwords with non ASCII characters when interacting with authenticating sources
1 participant