jacobschaer/python-doipclient

Error when using encrypted communication with preconfigured SSL context

Closed this issue · 2 comments

Hello,

if isinstance(self._use_secure, type(ssl.SSLContext)):

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! 👍

@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

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

:param use_secure: Enables TLS. If set to True, a default SSL context is used. For more control, a preconfigured
SSL context can be passed directly. Untested. Should be combined with changing tcp_port to 3496.