-
Notifications
You must be signed in to change notification settings - Fork 2.5k
certificate callback can't differentiate IPv6 and a port #6510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A possible solution is to return |
Since I suspect most certificate callback routines need to extract the host and port separately, instead of expecting them to parse a string I would suggest just making the port a separate parameter (or pass in some structure which can be extended in the future). Since changing the format of the host string may break existing implementations, I think for me it would be preferred to make that breakage explicit via an API change (or add an alternate callback with the different API if breakage is too much of a concern). |
I'm going to revert #6503. We'll sort this out for v1.7. |
Fixed in https://github.com/libgit2/libgit2/releases/v1.6.2 and opened #6515 to track a proper fix. |
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
ssh://user@[::1]:2022/somerepo
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
The text was updated successfully, but these errors were encountered: