Skip to content

Use MatchesHostname instead#12765

Merged
danegsta merged 1 commit intodotnet:mainfrom
danegsta:dev/danegsta/subjectTest
Nov 6, 2025
Merged

Use MatchesHostname instead#12765
danegsta merged 1 commit intodotnet:mainfrom
danegsta:dev/danegsta/subjectTest

Conversation

@danegsta
Copy link
Member

@danegsta danegsta commented Nov 6, 2025

Description

Use MatchesHostname instead of trying to directly compare the subject.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12765

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12765"

@danegsta danegsta enabled auto-merge (squash) November 6, 2025 19:33
@danegsta
Copy link
Member Author

danegsta commented Nov 6, 2025

/backport to release/13.0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19147556297

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors certificate hostname matching logic in the root certificate filtering code. The change replaces a direct string comparison of the certificate's Subject field with a call to a new MatchesHostname method.

  • Replaces string.Equals(c.Subject, "localhost", StringComparison.OrdinalIgnoreCase) with c.MatchesHostname("localhost") for improved abstraction

@danegsta danegsta merged commit f08d297 into dotnet:main Nov 6, 2025
302 of 303 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 6, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants