Skip to content

Inconsistent handling of IPv6 scope in SocketsHttpHandler's connection pool #135103

Description

@MihaZupan

The connection pool compares entries' ProxyUri with Uri equality which doesn't compare the IPv6 scope.

We could also consider making a breaking change to Uri's equality to account to the scope.

Activity

  1. added this to the 12.0.0 milestone on Oct 2, 2026
  2. dotnet-policy-service commented on Oct 2, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @karelz, @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  3. wfurt commented on Oct 2, 2026

    @wfurt
    Member

    I'd be in favor. I don't even think it is breaking change. We do use scope for IPAddress.

  4. makazeu commented on Oct 10, 2026

    @makazeu
    Contributor

    Confirmed on .NET 10.0.12: changing a scoped IPv6 proxy from %1 to %2 still selects %1 in ConnectCallback, even when the first connection attempt failed. This reproduces with HTTP, HTTPS, and SOCKS5 proxies for both HTTP and HTTPS requests.

    A targeted fix can make proxy pool keys scope-sensitive while retaining canonical URI equivalence. Changing Uri.Equals globally should be considered separately because it changes URI-keyed collection behavior.

    Working on a fix for proxy pool keys.

    Note

    This analysis was generated with GitHub Copilot.

  5. MihaZupan commented on Oct 11, 2026

    @MihaZupan
    MemberAuthor

    Changing Uri.Equals globally should be considered separately because it changes URI-keyed collection behavior.

    I disagree, I think fixing this in Uri would be cleaner.

  6. makazeu commented on Oct 12, 2026

    @makazeu
    Contributor

    9. > Changing Uri.Equals globally should be considered separately because it changes URI-keyed collection behavior.

    I disagree, I think fixing this in Uri would be cleaner.
    

    Working on raising another PR to fix Uri.Equals

    Update:
    PR done: #135617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions