Requirement:-
Make sure the username and password you are providing is correct .
Broker Url should be start with ssl:// and port is 8883
Step-3
To setup ,
1. we need to install mqtt and set up with ssl/tls .For this please follow this blog .
2. To install nifi with tls/ssl ,please follow this link .
Now we have to do configuration in nifi .
Step -1
Add MqttConsumer/Publisher processor in nifi .
Step-2
Configure the details in the configuration .
Broker Url should be start with ssl:// and port is 8883
Step-3
Goto SSL context service and chose the standardSSLContextService .
Here you have .crt file and .key .To generate keystore and trusstore please follow the below command
I am using ubuntu 18.04 .
Generate keystore:-
Goto you cert directory where you are storing your certificate .
create a empty file keystore and copy the private key ca.key and ca.crt respectively .
Command :
nano keystore
copy paste ca.key to keystore .
copy paste ca.crt to keystore .
then save it .
To generate keystore.p12 ,Please type below command .
openssl pkcs12 -export -in keystore -out keystore.p12
it will ask for password ,type the ca.key password everywhere so that easy to remember .
To generate trusstore.jks file ,please type this command below .
keytool -import -file ca.crt -keystore truststore.jks
Step-4