Bumping this up as I’m still having an issue here; has anyone gotten 
publishmqtt working with SSL?

Jeff Oxenberg

From: Oxenberg, Jeff
Sent: Tuesday, August 08, 2017 8:33 PM
To: [email protected]
Subject: publishmqtt with SSL

Hey,

I’m trying to get NiFi to send mqtt messages to the Azure IoT Hub.  The IoT Hub 
uses SSL certificates, and I’m having trouble getting it working with the 
publishmqtt processor.  I create a StandardSSLContextService pointing the 
truststore at /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts.  I 
made sure (I think) that the chain was trusted by importing it manually into 
the cacerts:
openssl s_client -showcerts -connect gsetest.azure-devices.net:8883 </dev/null 
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > msft.cert
keytool -import -noprompt -trustcacerts -alias azure -file msft.cert -keystore 
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts -storepass changeit

When I start the processor, I immediately get the below error.  This all works 
when I do it manually outside of NiFi using mosquitto_pub, so I know that my 
various settings (username, password, etc) are correct.  Has anyone done 
something similar, or can anyone offer any help here?

2017-08-08 17:20:28,570 ERROR [StandardProcessScheduler Thread-6] 
o.a.n.controller.StandardProcessorNode Failed to invoke @OnScheduled method due 
to java.lang.RuntimeException: Failed while executing one of processor's 
OnScheduled task.
java.lang.RuntimeException: Failed while executing one of processor's 
OnScheduled task.
        at 
org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1480)
        at 
org.apache.nifi.controller.StandardProcessorNode.access$000(StandardProcessorNode.java:100)
        at 
org.apache.nifi.controller.StandardProcessorNode$1.run(StandardProcessorNode.java:1301)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: 
java.lang.reflect.InvocationTargetException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)
        at 
org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1463)
        ... 9 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)

Thanks,


Jeff Oxenberg

Reply via email to