Skip to content

Commit

Permalink
enable ssl_context deprecation warning and fix it (#17127)
Browse files Browse the repository at this point in the history
* enable ssl_context deprecation warning and fix it

* one case

* a few more

* yup

* one more
  • Loading branch information
altendky authored Jan 3, 2024
1 parent 512f7b9 commit b5a58e4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion chia/daemon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def start(self) -> None:
autoclose=True,
autoping=True,
heartbeat=self.heartbeat,
ssl_context=self.ssl_context,
ssl=self.ssl_context,
max_msg_size=self.max_message_size,
)
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion chia/daemon/keychain_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def connect_to_keychain(self) -> None:
autoclose=True,
autoping=True,
heartbeat=self.heartbeat,
ssl_context=self.ssl_context,
ssl=self.ssl_context,
max_msg_size=self.max_message_size,
)
await self.listener()
Expand Down
2 changes: 1 addition & 1 deletion chia/rpc/rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def create_as_context(
await self.await_closed()

async def fetch(self, path, request_json) -> Dict[str, Any]:
async with self.session.post(self.url + path, json=request_json, ssl_context=self.ssl_context) as response:
async with self.session.post(self.url + path, json=request_json, ssl=self.ssl_context) as response:
response.raise_for_status()
res_json = await response.json()
if not res_json["success"]:
Expand Down
2 changes: 1 addition & 1 deletion chia/rpc/rpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ async def inner() -> None:
autoclose=True,
autoping=True,
heartbeat=self.daemon_heartbeat,
ssl_context=self.ssl_client_context,
ssl=self.ssl_client_context,
max_msg_size=max_message_size,
)
await self.connection(self.websocket)
Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ testpaths = tests
filterwarnings =
error
ignore:JSON contains both `coin_solutions` and `coin_spends`, just use `coin_spends`
ignore:ssl_context is deprecated:DeprecationWarning
ignore:Implicitly cleaning up:ResourceWarning
ignore:unclosed <socket\.socket:ResourceWarning
ignore:Unclosed client session:ResourceWarning
Expand Down
2 changes: 1 addition & 1 deletion tests/core/daemon/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ async def test_daemon_passthru(get_daemon, bt):
f"wss://127.0.0.1:{daemon_port}",
autoclose=True,
autoping=True,
ssl_context=bt.get_daemon_ssl_context(),
ssl=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
service_name = "test_service_name"
Expand Down
6 changes: 3 additions & 3 deletions tests/core/daemon/test_daemon_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def test_multiple_register_same(get_daemon: WebSocketServer, bt: BlockTool
f"wss://127.0.0.1:{daemon_port}",
autoclose=True,
autoping=True,
ssl_context=bt.get_daemon_ssl_context(),
ssl=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
service_name = "test_service"
Expand All @@ -48,7 +48,7 @@ async def test_multiple_register_different(get_daemon: WebSocketServer, bt: Bloc
f"wss://127.0.0.1:{daemon_port}",
autoclose=True,
autoping=True,
ssl_context=bt.get_daemon_ssl_context(),
ssl=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
test_service_names = ["service1", "service2", "service3"]
Expand Down Expand Up @@ -84,7 +84,7 @@ async def test_remove_connection(get_daemon: WebSocketServer, bt: BlockTools) ->
f"wss://127.0.0.1:{daemon_port}",
autoclose=True,
autoping=True,
ssl_context=bt.get_daemon_ssl_context(),
ssl=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
) as ws:
test_service_names = ["service1", "service2", "service3", "service4", "service5"]
Expand Down
2 changes: 1 addition & 1 deletion tests/simulation/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async def verify_daemon_connection(daemon: WebSocketServer, service: str) -> boo
f"wss://127.0.0.1:{full_system.daemon.daemon_port}",
autoclose=True,
autoping=True,
ssl_context=bt.get_daemon_ssl_context(),
ssl=bt.get_daemon_ssl_context(),
max_msg_size=100 * 1024 * 1024,
)
service_name = "test_service_name"
Expand Down

0 comments on commit b5a58e4

Please sign in to comment.