Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ResolveEndpoint has always taken the first entry from the AddressList…
…. If, for example, IPv6 has been completely deactivated on your system, AddressList still always contains the entry "::1" in the first place, which leads to problems in certain constellations. If, for example, virtual network adapters (e.g. Hyper-V Network Switch) are also used on the system, the first entry does not return the correct outgoing IP address. Numerous tests have confirmed that the last address in the list is always the correct and desired address. By setting onlyUseIPv4 = true you can force an IPv4 address to be returned, even if the list contains "::1", for example. As a rule, the AddressList contains IPv6 addresses first and then IPv4 addresses. However, there are situations where additional IPv6 addresses appear in the list after the IPv4 addresses, and these are the correct addresses that you actually want. My changes cover all cases and you have full control over what the end result is. Otherwise, for example, an IP address from a Hyper-V switch is incorrectly used for a hostname. Connection problems arise, especially in conjunction with SSL and an SSL certificate that is then issued for this hostname or IP address.
- Loading branch information