From b543178fe7920d3dd475040a598e686a3fec761e Mon Sep 17 00:00:00 2001 From: Alex Ruddick Date: Mon, 29 Apr 2024 14:33:10 -0500 Subject: [PATCH] Fix type hints to allow Path --- asyncua/client/client.py | 4 ++-- asyncua/server/server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asyncua/client/client.py b/asyncua/client/client.py index ea1c38eee..5e17c3624 100644 --- a/asyncua/client/client.py +++ b/asyncua/client/client.py @@ -182,8 +182,8 @@ async def set_security_string(self, string: str) -> None: async def set_security( self, policy: Type[ua.SecurityPolicy], - certificate: Union[str, uacrypto.CertProperties, bytes], - private_key: Union[str, uacrypto.CertProperties, bytes], + certificate: Union[str, uacrypto.CertProperties, bytes, Path], + private_key: Union[str, uacrypto.CertProperties, bytes, Path], private_key_password: Optional[Union[str, bytes]] = None, server_certificate: Optional[Union[str, uacrypto.CertProperties, bytes]] = None, mode: ua.MessageSecurityMode = ua.MessageSecurityMode.SignAndEncrypt, diff --git a/asyncua/server/server.py b/asyncua/server/server.py index c24bc78a3..471ef4733 100644 --- a/asyncua/server/server.py +++ b/asyncua/server/server.py @@ -226,7 +226,7 @@ def __str__(self): return f"OPC UA Server({self.endpoint.geturl()})" __repr__ = __str__ - async def load_certificate(self, path_or_content: Union[str, bytes], format: str = None): + async def load_certificate(self, path_or_content: Union[str, bytes, Path], format: str = None): """ load server certificate from file, either pem or der """