Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add support for PyOpenSSL in paho.mqtt.python #849

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

IniterWorker
Copy link

@IniterWorker IniterWorker commented Jun 5, 2024

This PR aims to introduce support for PyOpenSSL in the paho.mqtt.python library. The primary focus is on enabling the provision of a custom SSL.Context within the MQTT client. This enhancement is essential for ensuring compatibility with PKCS#11, as discussed in issue #646.

Changes:

  • Added functionality to provide a custom SSL.Context within the MQTT client.
  • Utilized the tls_set_context method to facilitate compatibility with both ssl.SSLContext and SSL.Context.

Purpose:

The introduction of PyOpenSSL support serves to broaden the library's compatibility spectrum, particularly for scenarios involving PKCS#11 integration. This enhancement enhances the versatility and usability of the paho.mqtt.python library.

Related Issue:

Related Work:

Notes for Reviewers:

Your feedback on the implementation approach and any suggestions for further improvements are highly appreciated.

Signed-off-by: Walter BONETTI <[email protected]>
@IniterWorker IniterWorker force-pushed the feature/pyopenssl-context branch from 2b7eaa7 to 1b2d5e4 Compare June 6, 2024 14:26
Signed-off-by: Walter BONETTI <[email protected]>
@IniterWorker IniterWorker force-pushed the feature/pyopenssl-context branch from ba24c43 to 02b583c Compare July 29, 2024 21:28
SSL.ZeroReturnError is raised when the connection has been closed cleanly,
and no more data will be received. This behavior indicates that the connection
is no longer usable and thus can be considered a type of connection error.
Therefore, it is appropriate to raise a ConnectionError when encountering SSL.ZeroReturnError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant