mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-28 01:45:22 +03:00
enable ssl_context deprecation warning and fix it (#17127)
* enable ssl_context deprecation warning and fix it * one case * a few more * yup * one more
This commit is contained in:
parent
512f7b9fc5
commit
b5a58e4998
@ -43,7 +43,7 @@ class DaemonProxy:
|
|||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
heartbeat=self.heartbeat,
|
heartbeat=self.heartbeat,
|
||||||
ssl_context=self.ssl_context,
|
ssl=self.ssl_context,
|
||||||
max_msg_size=self.max_message_size,
|
max_msg_size=self.max_message_size,
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -110,7 +110,7 @@ class KeychainProxy(DaemonProxy):
|
|||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
heartbeat=self.heartbeat,
|
heartbeat=self.heartbeat,
|
||||||
ssl_context=self.ssl_context,
|
ssl=self.ssl_context,
|
||||||
max_msg_size=self.max_message_size,
|
max_msg_size=self.max_message_size,
|
||||||
)
|
)
|
||||||
await self.listener()
|
await self.listener()
|
||||||
|
@ -80,7 +80,7 @@ class RpcClient:
|
|||||||
await self.await_closed()
|
await self.await_closed()
|
||||||
|
|
||||||
async def fetch(self, path, request_json) -> Dict[str, Any]:
|
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()
|
response.raise_for_status()
|
||||||
res_json = await response.json()
|
res_json = await response.json()
|
||||||
if not res_json["success"]:
|
if not res_json["success"]:
|
||||||
|
@ -376,7 +376,7 @@ class RpcServer(Generic[_T_RpcApiProtocol]):
|
|||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
heartbeat=self.daemon_heartbeat,
|
heartbeat=self.daemon_heartbeat,
|
||||||
ssl_context=self.ssl_client_context,
|
ssl=self.ssl_client_context,
|
||||||
max_msg_size=max_message_size,
|
max_msg_size=max_message_size,
|
||||||
)
|
)
|
||||||
await self.connection(self.websocket)
|
await self.connection(self.websocket)
|
||||||
|
@ -16,7 +16,6 @@ testpaths = tests
|
|||||||
filterwarnings =
|
filterwarnings =
|
||||||
error
|
error
|
||||||
ignore:JSON contains both `coin_solutions` and `coin_spends`, just use `coin_spends`
|
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:Implicitly cleaning up:ResourceWarning
|
||||||
ignore:unclosed <socket\.socket:ResourceWarning
|
ignore:unclosed <socket\.socket:ResourceWarning
|
||||||
ignore:Unclosed client session:ResourceWarning
|
ignore:Unclosed client session:ResourceWarning
|
||||||
|
@ -420,7 +420,7 @@ async def test_daemon_passthru(get_daemon, bt):
|
|||||||
f"wss://127.0.0.1:{daemon_port}",
|
f"wss://127.0.0.1:{daemon_port}",
|
||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
ssl_context=bt.get_daemon_ssl_context(),
|
ssl=bt.get_daemon_ssl_context(),
|
||||||
max_msg_size=100 * 1024 * 1024,
|
max_msg_size=100 * 1024 * 1024,
|
||||||
) as ws:
|
) as ws:
|
||||||
service_name = "test_service_name"
|
service_name = "test_service_name"
|
||||||
|
@ -21,7 +21,7 @@ async def test_multiple_register_same(get_daemon: WebSocketServer, bt: BlockTool
|
|||||||
f"wss://127.0.0.1:{daemon_port}",
|
f"wss://127.0.0.1:{daemon_port}",
|
||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
ssl_context=bt.get_daemon_ssl_context(),
|
ssl=bt.get_daemon_ssl_context(),
|
||||||
max_msg_size=100 * 1024 * 1024,
|
max_msg_size=100 * 1024 * 1024,
|
||||||
) as ws:
|
) as ws:
|
||||||
service_name = "test_service"
|
service_name = "test_service"
|
||||||
@ -48,7 +48,7 @@ async def test_multiple_register_different(get_daemon: WebSocketServer, bt: Bloc
|
|||||||
f"wss://127.0.0.1:{daemon_port}",
|
f"wss://127.0.0.1:{daemon_port}",
|
||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
ssl_context=bt.get_daemon_ssl_context(),
|
ssl=bt.get_daemon_ssl_context(),
|
||||||
max_msg_size=100 * 1024 * 1024,
|
max_msg_size=100 * 1024 * 1024,
|
||||||
) as ws:
|
) as ws:
|
||||||
test_service_names = ["service1", "service2", "service3"]
|
test_service_names = ["service1", "service2", "service3"]
|
||||||
@ -84,7 +84,7 @@ async def test_remove_connection(get_daemon: WebSocketServer, bt: BlockTools) ->
|
|||||||
f"wss://127.0.0.1:{daemon_port}",
|
f"wss://127.0.0.1:{daemon_port}",
|
||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
ssl_context=bt.get_daemon_ssl_context(),
|
ssl=bt.get_daemon_ssl_context(),
|
||||||
max_msg_size=100 * 1024 * 1024,
|
max_msg_size=100 * 1024 * 1024,
|
||||||
) as ws:
|
) as ws:
|
||||||
test_service_names = ["service1", "service2", "service3", "service4", "service5"]
|
test_service_names = ["service1", "service2", "service3", "service4", "service5"]
|
||||||
|
@ -162,7 +162,7 @@ class TestSimulation:
|
|||||||
f"wss://127.0.0.1:{full_system.daemon.daemon_port}",
|
f"wss://127.0.0.1:{full_system.daemon.daemon_port}",
|
||||||
autoclose=True,
|
autoclose=True,
|
||||||
autoping=True,
|
autoping=True,
|
||||||
ssl_context=bt.get_daemon_ssl_context(),
|
ssl=bt.get_daemon_ssl_context(),
|
||||||
max_msg_size=100 * 1024 * 1024,
|
max_msg_size=100 * 1024 * 1024,
|
||||||
)
|
)
|
||||||
service_name = "test_service_name"
|
service_name = "test_service_name"
|
||||||
|
Loading…
Reference in New Issue
Block a user