Skip to content
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

lws fails to queue connection when mixing IP and Hostname #3338

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yassineBT
Copy link

LWS fails to queue connection when mixing IP and Hostname, the issue occurs due to how lws_client_connect_info fields (address, origin, and host) are configured. Specifically, when the fields are set as follows:

address = IP
origin = hostname
host = hostname

Example:

address = 81.71.211.11
origin = ybt.test.com
host = ybt.test.com

Using an IP address instead of a hostname prevents LWS from performing DNS resolution, as the resolution is handled externally. However, with this configuration, LWS incorrectly compares 81.71.211.11 with ybt.test.com for the second session, treating it as a new session instead of an existing one.

Fix:
Ensure consistent comparison by matching IP to IP or host to host. This fix updates the logic to compare IP addresses directly, preventing LWS from incorrectly creating a new session instead of properly queuing it.

@lws-team
Copy link
Member

lws-team commented Mar 2, 2025

Thanks... I don't really want to change the behaviour for the normal case that the address is a DNS name, as this patch seems to do.

For the vast majority of people, they are using TLS and it is based on confirming that the cert that is served and signed by the CA, matches the DNS name.

I understand the behaviour at the moment when using pipelining with an IP address is wrong, but it sounds like the patch should work around that for the explicit IP case only, and leave the normal case as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants