Closed yefuwang closed 3 years ago
Hello Yefu,
thank for sharing. It's been quite I while since I last checked anything in Python.
I'm just not sure about the connection rebuilding commit, because if "tlsEnable" is set to false, that "if (mode == 'plain')" in line 531 should never be reached, because it would exit in line 449. And if TLS is enabled, it should not connect unencrypted by accident.
I have to think about it at least. But I'll merge the other commits.
Thanks again and greetings Tobias
Hi Tobias,
In my tests, it reached this branch with the connection closed. TLS is enabled but the server probably does not support TLS. I think this is what happened:
When this happened, the plain exception was closed when it reaches the place I made the change. Therefore I tried to reopen it.
Regards, Yefu
Hello Yefu,
I think I just did it somewhat messy.
The best way is this: one knows if the SIP2 server supports TSL or not and sets the configuration variable self.tlsEnable accordingly. If the server does not support TSL and I know this, then it would quit at about line 448. This would be the cleanest thing (I know what my server support) and should work correctly.
But you're right about 474, I tried to offer an easy way if someone does not know if the server settings are plain or TSL (memories are coming back :)). And even though I didn't test it, I assume you're right that the plain connection breaks in the described way. Thanks for your explanation and the workaround! I'll push it in a second.
It's really been a long time :)
Greetings Tobias
I merged all four commits by cherry picking. Therefore I close this PR without the built in merge action.
Thanks again :)
Hi Tobias,
Here is a PR with 4 commits to addressing some issues described in the commit messages. Thank you very much for the good project.
Regards, Yefu