We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi everyone
I want to use ca.crt, client.crt, client.key to connect mqtt broker.
My code like following:
client = MQTTClient(clientId) print("Before ", client.is_connected) contextInstance = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) contextInstance.load_default_certs() contextInstance.load_verify_locations(cafile=tls_CERT_PATH, cadata=None, capath=None) contextInstance.verify_mode =ssl.CERT_REQUIRED contextInstance.load_cert_chain(certfile=tls_CLIENT_PATH, keyfile=tls_CLIENTKEY_PATH) contextInstance.check_hostname=False result = await client.connect(host=broker,port=port,ssl=contextInstance) print("Result ", result) print("client.is_connected ", client.is_connected)
And the execute result is:
Before False
The execute is stop at the following line code
result = await client.connect(host=broker,port=port,ssl=contextInstance)
Can someone tell me how to fix it?
Thanks for your watching and any idea.
The X509 certificate file content is: ca.crt -> Just a ca certificate. Content as following
-----BEGIN CERTIFICATE----- content message -----END CERTIFICATE-----
client.crt -> Just a client certificate. Content as following
client.key -> Just a client key. Content as following
-----BEGIN PRIVATE KEY----- content message -----END PRIVATE KEY------
The text was updated successfully, but these errors were encountered:
Hi, thanks for the issue. Please clarify your env (os, broker version).
By the way we have already faced with a same issue in the past, please try to read and may be it will help you #122 (comment)
Sorry, something went wrong.
I have the same problem in windows
No branches or pull requests
Hi everyone
I want to use ca.crt, client.crt, client.key to connect mqtt broker.
My code like following:
And the execute result is:
The execute is stop at the following line code
Can someone tell me how to fix it?
Thanks for your watching and any idea.
The X509 certificate file content is:
ca.crt -> Just a ca certificate. Content as following
client.crt -> Just a client certificate. Content as following
client.key -> Just a client key. Content as following
The text was updated successfully, but these errors were encountered: