jacobschaer / python-doipclient

Pure Python ISO 13400 Client
MIT License
151 stars 50 forks source link

Error when using encrypted communication with preconfigured SSL context #36

Closed alexeckle closed 1 year ago

alexeckle commented 1 year ago

Hello,

https://github.com/jacobschaer/python-doipclient/blob/f278a59b21c996bf67ad7afe4783ef04a7f79f08/doipclient/client.py#L777

If I create a DoIPClient instance with use_secure=ssl_context _connect still tries to create a default context. I think that in client.py, line 777, in isinstance, type is not needed.

How it works on my setup: if isinstance(self._use_secure, ssl.SSLContext):

Thank you very much for providing this great library! 👍

jacobschaer commented 1 year ago

@sfaiss made the change, I didn't test it. I believe you're correct though. Feel free to make a PR and I can merge that.

sfaiss commented 1 year ago

Please check #38 for the updated implementation and tests.

@alexeckle: Besides that oversight, did the encrypted communication work for you? If so, we could also remove the untested from the docstring

https://github.com/jacobschaer/python-doipclient/blob/f278a59b21c996bf67ad7afe4783ef04a7f79f08/doipclient/client.py#L145-L146