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

"ssl.TLSVersion = tls_version" in deye_config.py breaks modules using urllib3 (problem for plugin development) #169

Open
MaikNeubert opened this issue Apr 28, 2024 · 2 comments
Labels
enhancement New feature or request stale

Comments

@MaikNeubert
Copy link

MaikNeubert commented Apr 28, 2024

Hello,

I am currently developing a plugin to write data directly to InfluxDB. Because you directly manipulate the TSLVersion object from the SSL module, this breaks compatibility with probably a lot of modules that make requests over HTTP(S), such as the InfluxDB Python client, resulting in errors like

AttributeError: '_SSLMethod' object has no attribute 'TLSv1_2'.

This, at least for me, is a big problem for plugin development. In this issue, I would kindly ask if we could investigate a better solution that does not involve manipulating the SSL module directly.

I would also be ready to investigate the project and try to find a solution next month if you accept external contributions. I can then try to make a proposal here, and if you accept, maybe create a PR.

class DeyeMqttTlsConfig:
    def __init__(
        self,
        enabled: bool = False,
        ca_cert_path: str = "",
        client_cert_path: str = "",
        client_key_path: str = "",
        tls_version=ssl.PROTOCOL_TLSv1_2,
        insecure=False,
    ):
        self.enabled = enabled
        self.__ca_cert_path = ca_cert_path
        self.__client_cert_path = client_cert_path
        self.__client_key_path = client_key_path
        ssl.TLSVersion = tls_version # problamatic solution
        self.insecure = insecure
@MaikNeubert MaikNeubert added the enhancement New feature or request label Apr 28, 2024
@kbialek
Copy link
Owner

kbialek commented Apr 28, 2024

I would also be ready to investigate the project and try to find a solution next month if you accept external contributions. I can then try to make a proposal here, and if you accept, maybe create a PR.

Of course. Contributions are welcome.

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants