Skip to content

Conversation

@emlowe
Copy link
Contributor

@emlowe emlowe commented Dec 12, 2025

Taking a look at old issue [#17923] - aiohttp has supported passing server_hostname into ws_connect for a few releases.

This PR will always pass in server_hostname even if it's an IP address, which may be harmless but I'm not sure and might need some adjustment to only pass in things that look like FQDNs.

I'm not clear on how to test this, but it should work, but only for those hosts listed using FQDNs in the config. Note that P2P node discovery only deals in IPs, so this cannot work in that case.

This uses the so-called ugly way from the bug but I choose this as it keeps everything else the same.


Note

Add optional server_hostname to outbound ws connections and pass unresolved host as SNI/Host header when dialing configured peers.

  • Networking / Outbound connections:
    • ChiaServer.start_client(...) adds server_hostname: str | None param.
    • Propagate SNI/Host to aiohttp by setting server_hostname and headers={"Host": server_hostname} in ws_connect when provided.
    • Service._connect_peers_task_handler: pass the original unresolved hostname (unresolved.host) to start_client(..., server_hostname=...) for configured peers.

Written by Cursor Bugbot for commit f9a0190. This will update automatically on new commits. Configure here.

@emlowe emlowe added the Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog label Dec 12, 2025
@emlowe
Copy link
Contributor Author

emlowe commented Dec 15, 2025

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 20177709965

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 111 unchanged lines in 27 files lost coverage.
  • Overall coverage decreased (-0.1%) to 90.789%

Files with Coverage Reduction New Missed Lines %
chia/cmds/plotnft_funcs.py 1 85.42%
chia/full_node/block_store.py 1 96.6%
chia/server/chia_policy.py 1 94.52%
chia/_tests/rpc/test_rpc_server.py 1 98.97%
chia/_tests/simulation/test_simulation.py 1 96.47%
chia/wallet/util/wallet_sync_utils.py 1 85.57%
chia/wallet/wallet_state_manager.py 1 96.43%
chia/wallet/wallet_user_store.py 1 98.18%
chia/data_layer/data_layer.py 2 86.1%
chia/data_layer/data_store.py 2 95.52%
Totals Coverage Status
Change from base Build 20208481264: -0.1%
Covered Lines: 102749
Relevant Lines: 113003

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant