OpenSSL.SSL' has no attribute 'TLSv1_3_METHOD

I have gotten the site working, but my python file that I use to connect to the mqtt broker, doesn’t want to support tlsv3 and it errors out, I’m using openssl 1.1.1.n and it still doesn’t want to, it says AttributeError: module ‘OpenSSL.SSL’ has no attribute ‘TLSv1_3_METHOD’` Please help me fix this


pyopenssl doesn’t have that method. The documentation states:

These constants represent the different SSL methods to use when creating a context object. New code should only use TLS_METHOD, TLS_SERVER_METHOD, or TLS_CLIENT_METHOD. If the underlying OpenSSL build is missing support for any of these protocols, constructing a Context using the corresponding *_METHOD will raise an exception.

So it looks like you should be using TLS_CLIENT_METHOD.