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:
Kyle Altendorf 2024-01-02 20:07:31 -05:00 committed by GitHub
parent 512f7b9fc5
commit b5a58e4998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 10 deletions

View File

@ -43,7 +43,7 @@ class DaemonProxy:
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:

View File

@ -110,7 +110,7 @@ class KeychainProxy(DaemonProxy):
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()

View File

@ -80,7 +80,7 @@ class RpcClient:
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"]:

View File

@ -376,7 +376,7 @@ class RpcServer(Generic[_T_RpcApiProtocol]):
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)

View File

@ -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

View File

@ -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"

View File

@ -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"
@ -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"]
@ -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"]

View File

@ -162,7 +162,7 @@ class TestSimulation:
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"