22.05.2023, 06:52
When only server certificate is needed for testing purposes you can simply skip the validation by setting client:tls_insecure_set(true).
If this works then you can disable insecure mode and profile server certificate: client:tls_set(path_to_pem_file)
Certificate file can be uploaded via FTP, the path will be /data/ftp/mqtt.pem or similar. Note that this file must be in PEM format and it must contain the whole certificate chain for the server.
For both client and server certificates the use the following code:
Client private key must not have an additional password.
If this works then you can disable insecure mode and profile server certificate: client:tls_set(path_to_pem_file)
Certificate file can be uploaded via FTP, the path will be /data/ftp/mqtt.pem or similar. Note that this file must be in PEM format and it must contain the whole certificate chain for the server.
For both client and server certificates the use the following code:
Code:
client:tls_set(path_to_server_pem_file, nil, path_to_client_pem_file, path_to_client_key_file)