Skip to content

certificate callback can't differentiate IPv6 and a port #6510

@ehuss

Description

@ehuss

The change introduced in #6503 prevents determining which part of the host string is an IPv6 address and which is the port number.

cc @fxcoudert

Reproduction steps

  1. Clone a repo using an IPv6 address with a port. For example, ssh://user@[::1]:2022/somerepo
  2. Have a certificate callback function.

Expected behavior

The certificate callback function can determine what is the host and what is the port.

I'm guessing there is reluctance to make an API breaking change to the callback function to add the port as a separate parameter? That would ultimately be my preference, but I can understand if there are concerns about API changes. However, this resulted in a behavioral change which is roughly equivalent to an API breaking change. Code expecting the value to be a host string no longer works.

Actual behavior

The host string is passed as ::1:2022 preventing a reliable way to determine which part is the IP address and which part is the host.

Version of libgit2 (release number or SHA1)

1.6.1

Operating system(s) tested

Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions