DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
Per Python ssl docs, the PROTOCOL_TLS has been deprecated, replaced with PROTOCOL_TLS_CLIENT/SERVER. This setting is used in the client at:
https://github.com/eclipse/paho.mqtt.python/blob/9782ab81fe7ee3a05e74c7f3e1d03d5611ea4be4/src/paho/mqtt/client.py#L791
From what I understood, the PROTOCOL_TLS_CLIENT should be the correct replacement (for client connections), but it has some side effects:
The protocol enables CERT_REQUIRED and check_hostname by default.
Looking at the client code, this seems to be the defaults for tls_set as well. Replacing the PROTOCOL_TLS with PROTOCOL_TLS_CLIENT, while using PROTOCOL_TLS as a fallback for Python 2.7 should remove the deprecation warning.
I could open a PR if the proposed solution sounds like a good idea.
@maranov sounds good to me. Would love to see this warning disappear. 👍
As PR #665 has now been merged I believe this issue can be closed. Note that there are a few other related issues that will remain open (the documentation does not really match the code).
Note: This is part of an exercise to clean up old issues so that the project can move forwards. Due to the number of issues being worked through mistakes will be made; please feel free to reopen this issue (or comment) if you believe it's been closed in error.