-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Connecting to FQDN peers with SNI is broken #17923
Comments
3.9 aiohttp supports SNI so maybe it can be added What feature are you trying to implement exactly felix? |
I wanted to connect to a full node behind cloudflare, but it would be the same for users trying to connect to one behind nginx, given that they host multiple servers on the same port, for example 443. This however is currently broken and does not work, as the correct endpoint to connect to can not be mapped as that info is missing (bc it connects to the resolved ip instead of connecting to the hostname in the config, and letting the library handle resolving and properly connecting to it). |
I did some testing, i think there are two approaches to solve this:
ws_connect(
"wss://1.2.3.4/ws",
server_hostname=unresolved_peer_info.host,
headers={
"Host": unresolved_peer_info.host,
},
) Currently aiohttp can not set the server_hostname for |
Is this just farmers trying to connect to a node or do you want node-node traffic working like this? |
I'd love to see it work for both, but primary is farmer to node |
Looks like we need a new release of main aiohttp as well |
we can probably get farmer to node working |
for the ugly way, yes i'd much prefer the correct way |
node - node gossip may be an issue. i think it only supports ip. the bigger issue is the current strategy for nodes is to resolve as early as possible, so this is opposite of that. |
Yeah resolving happens in chia-blockchain before connecting and it makes sense for network based configs, like determining if a peer is trusted/whitelisted etc, but i'm not sure for which other reasons this might happen, or is needed even. |
In the interim would running a proxy work to map the IP connections to a domain name? Its kludgy but should work |
Nope, because if you map ip to domain in a proxy you could just host on the ip itself in the first place, which is not desired and possible in my case. |
it is in our backlog as i mentioned in discord, not sure if this is an especially priority issue however. |
Currently when a FQDN is used to connect to a peer which requires SNI to correctly route the request to the host, no connection can be established. This is due to chia itself resolving the host and using the resulting ip to connect to it, breaking SNI.
The text was updated successfully, but these errors were encountered: