I am trying to setup a mongo extractor process using GetMongo with Mongo X509 auth.
It works from my Java code using the following properties.
1. Mongo URI - mongodb://C=US,ST=Texas,O=Test Inc.,OU=management:ad.group.372,CN=test.com@host1:10900,host2:10901,host3:10901/eos-uat?replicaSet=testApp&journal=true&authMechanism=MONGODB-X509
2. Keystore
3. Keystore password
4. Trustrore
5. Truststore password
I am trying with the same props in Nifi and throws the following error.
o.a.nifi.processors.mongodb.GetMongo GetMongo[id=44d0b0a4-0187-1000-c77e-135ce0fedc67] Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to java.lang.IllegalArgumentException: Invalid mechanism, MONGODB_x509 does not support passwords
java.lang.IllegalArgumentException: Invalid mechanism, MONGODB_x509 does not support passwords
at com.mongodb.ConnectionString.createMongoCredentialWithMechanism(ConnectionString.java:893)
at com.mongodb.ConnectionString.createCredentials(ConnectionString.java:832)
at com.mongodb.ConnectionString.<init>(ConnectionString.java:447)
at org.apache.nifi.processors.mongodb.AbstractMongoProcessor.getClientSettings(AbstractMongoProcessor.java:267)
at org.apache.nifi.processors.mongodb.AbstractMongoProcessor.createClient(AbstractMongoProcessor.java:256)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:145)
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:133)
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:78)
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:55)
at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$8(StandardProcessorNode.java:1736)
at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
SSLContext Service validation passes without any issues for the given keystore, keystore password, truststore, truststore passord. Not sure why the above error is coming.