<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Insights from Troubleshooting]]></title><description><![CDATA[Insights from Troubleshooting]]></description><link>https://pnac03.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 09:30:44 GMT</lastBuildDate><atom:link href="https://pnac03.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Apache NiFi is not listening on 0.0.0.0 or custom IP]]></title><description><![CDATA[Apache NiFi is a popular tool to simulate, implement and manage DataFlows for small Projects or even at Enterprise Scale. The various processors with their many functions combined with a simple and interactive UI makes it a very powerful platform for...]]></description><link>https://pnac03.hashnode.dev/apache-nifi-is-not-listening-on-0000-or-custom-ip</link><guid isPermaLink="true">https://pnac03.hashnode.dev/apache-nifi-is-not-listening-on-0000-or-custom-ip</guid><category><![CDATA[apache nifi]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[data flow ]]></category><category><![CDATA[Linux]]></category><category><![CDATA[troubleshooting]]></category><category><![CDATA[error]]></category><dc:creator><![CDATA[Aditya Charan]]></dc:creator><pubDate>Sat, 19 Apr 2025 20:33:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745093989340/75c84d1c-ebea-4385-a6d1-87b310cc4b1d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Apache NiFi is a popular tool to simulate, implement and manage DataFlows for small Projects or even at Enterprise Scale. The various processors with their many functions combined with a simple and interactive UI makes it a very powerful platform for the purpose. Besides, having been written in Java, its usecases are very diverse from simulating standard ETL pipelines and executing Groovy Scripts to support for many other Open-Source Plugins such as those of HashiCorp, Azure, AWS, GCP, and Zoho.</em></p>
<p><em>Apache NiFi version at the time of writing</em> <strong>- Apache NiFi v2.3.0</strong></p>
<h3 id="heading-platforms-and-version"><strong>Platforms and Version</strong></h3>
<p><strong>Platforms observed</strong></p>
<ul>
<li><p>Executing Release Binaries on Linux/Windows/MacOS - <strong><em>Yes</em></strong></p>
</li>
<li><p>Docker - <strong><em>No</em></strong></p>
</li>
</ul>
<p><strong>Version</strong></p>
<ul>
<li>Apache NiFi version at the time of writing <strong>- <em>Apache NiFi v2.3.0</em></strong></li>
</ul>
<h3 id="heading-explanation-of-the-issue"><strong>Explanation of the issue</strong>:</h3>
<p>While installing Apache NiFi, the NiFi server defaults to listening on <code>localhost</code>. Changing the default host in <code>conf/nifi.properties</code> causes issues and the server fails to listen on the specified hostname. Changing the default properties causes SNI Errors (Error Code 400) and NiFi web interface doesn’t load. Even trying to curl 127.0.0.1 may not work.</p>
<h3 id="heading-solution"><strong>Solution</strong></h3>
<p>NiFi server uses HTTPS by default and uses a self-signed certificate that is typically configured with a Subject Alternative Name (SAN) that only includes <code>localhost</code>. This means connections will only be properly validated when accessing the server via <code>https://localhost:port/nifi</code></p>
<p>Hence, besides the correct host configurations, a corresponding certificate has to be associated with the server so that it can validate connections coming from other sources. For the purpose of this article, let’s assume we want the server to validate connections coming through any network interface associated with the host machine</p>
<h1 id="heading-steps-to-configure-nifi-to-listen-on-0000">Steps to configure NiFi to listen on 0.0.0.0</h1>
<h3 id="heading-1-stop-the-nifi-server"><strong>1) Stop the NiFi Server</strong></h3>
<pre><code class="lang-bash">$ <span class="hljs-built_in">cd</span> &lt;nifi_directory&gt;
$ ./bin/nifi.sh stop
</code></pre>
<h3 id="heading-find-the-nifiproperties-file"><strong>Find the nifi.properties file</strong></h3>
<pre><code class="lang-bash">$ nano &lt;nifi_directory&gt;/conf/nifi.properties
</code></pre>
<h3 id="heading-make-sure-the-following-properties-are-updated-as-shown-below"><strong>Make sure the following properties are updated as shown below</strong></h3>
<pre><code class="lang-bash">
<span class="hljs-comment"># Site to Site properties</span>
nifi.remote.input.host=0.0.0.0
nifi.remote.input.secure=<span class="hljs-literal">true</span>
nifi.remote.input.socket.port=10000

<span class="hljs-comment">#############################################</span>

nifi.web.https.host=0.0.0.0
nifi.web.https.port=8443
nifi.web.https.network.interface.default=
nifi.web.https.application.protocols=h2 http/1.1
nifi.web.jetty.working.directory=./work/jetty
nifi.web.jetty.threads=200
nifi.web.max.header.size=16 KB
nifi.web.proxy.context.path=
nifi.web.proxy.host=
nifi.web.max.content.size=
nifi.web.max.requests.per.second=30000
nifi.web.max.access.token.requests.per.second=25
nifi.web.request.timeout=60 secs
nifi.web.request.ip.whitelist=
nifi.web.should.send.server.version=<span class="hljs-literal">true</span>
nifi.web.request.log.format=%{client}a - %u %t <span class="hljs-string">"%r"</span> %s %O <span class="hljs-string">"%{Referer}i"</span> <span class="hljs-string">"%{User-Agent}i"</span>
</code></pre>
<h3 id="heading-generate-the-pkcs12-certificates-using-keytool"><strong>Generate the PKCS#12 certificates using keytool</strong></h3>
<p>Use <code>keytool</code> to generate new PKCS#12 certificates with appropriate Subject Alternative Names (SAN) in the certificates that actually enables it to accept connections from 0.0.0.0</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">cd</span> &lt;nifi_directory&gt;/conf/
<span class="hljs-comment"># copy the old keystore and trustore certificates</span>
$ mv keystore.p12 keystore.p12-bak
$ mv truststore.p12 truststore.p12-bak
$ rm truststore.12 keystore.12
<span class="hljs-comment"># use keytool to generate new certificates with appropriate Subject Alternative Names (SAN) in the certificates that actually enables it to accept connections from 0.0.0.0 (anywhere)</span>

<span class="hljs-comment"># Example for generating a new keystore with SANs</span>
$ KEYSTORE_FILE=<span class="hljs-string">"nifi.keystore.p12"</span>
$ KEYSTORE_PASS=<span class="hljs-string">"your_keystore_password"</span>
$ KEY_ALIAS=<span class="hljs-string">"nifi-server"</span>
$ KEY_PASS=<span class="hljs-string">"your_key_password"</span>
$ HOSTNAME=<span class="hljs-string">"0.0.0.0"</span> <span class="hljs-comment"># This will be the CN, but SANs will handle other addresses</span>
$ IP_ADDRESS=<span class="hljs-string">"YOUR_MACHINE_IP"</span> <span class="hljs-comment"># Replace with your actual IP</span>

$ SUBJECT=<span class="hljs-string">"CN=<span class="hljs-variable">${HOSTNAME}</span>, OU=NIFI, O=NIFI, L=Bengaluru, ST=Karnataka, C=IN"</span>
SAN=<span class="hljs-string">"DNS:localhost,IP:127.0.0.1,IP:<span class="hljs-variable">${IP_ADDRESS}</span>"</span> <span class="hljs-comment"># Add more DNS or IP entries as needed</span>

$ keytool -genkeypair -<span class="hljs-built_in">alias</span> <span class="hljs-string">"<span class="hljs-variable">${KEY_ALIAS}</span>"</span> -keyalg RSA -keysize 2048 \
        -validity 365 -keystore <span class="hljs-string">"<span class="hljs-variable">${KEYSTORE_FILE}</span>"</span> -storetype PKCS12 \
        -storepass <span class="hljs-string">"<span class="hljs-variable">${KEYSTORE_PASS}</span>"</span> -keypass <span class="hljs-string">"<span class="hljs-variable">${KEY_PASS}</span>"</span> -dname <span class="hljs-string">"<span class="hljs-variable">${SUBJECT}</span>"</span> \
        -ext <span class="hljs-string">"SAN=<span class="hljs-variable">${SAN}</span>"</span>

<span class="hljs-comment"># If you also need a truststore (often the same for self-signed):</span>
$ TRUSTSTORE_FILE=<span class="hljs-string">"nifi.truststore.p12"</span>
$ TRUSTSTORE_PASS=<span class="hljs-string">"your_truststore_password"</span>

$ keytool -exportcert -<span class="hljs-built_in">alias</span> <span class="hljs-string">"<span class="hljs-variable">${KEY_ALIAS}</span>"</span> -keystore <span class="hljs-string">"<span class="hljs-variable">${KEYSTORE_FILE}</span>"</span> -storetype PKCS12 \
        -storepass <span class="hljs-string">"<span class="hljs-variable">${KEYSTORE_PASS}</span>"</span> -rfc -file nifi.cert

$ keytool -importcert -<span class="hljs-built_in">alias</span> <span class="hljs-string">"<span class="hljs-variable">${KEY_ALIAS}</span>"</span> -file nifi.cert \
        -keystore <span class="hljs-string">"<span class="hljs-variable">${TRUSTSTORE_FILE}</span>"</span> -storetype PKCS12 \
        -storepass <span class="hljs-string">"<span class="hljs-variable">${TRUSTSTORE_PASS}</span>"</span> -trustcacerts -noprompt

$ rm nifi.cert <span class="hljs-comment"># Clean up the temporary certificate file</span>
</code></pre>
<p><mark>Remember the passwords for the keystore and truststore certificates</mark></p>
<h3 id="heading-update-the-certificate-credentials-in-the-nifi-configuration"><strong>Update the Certificate credentials in the NiFi Configuration</strong></h3>
<p>Go back into nifi.properties and update the certificate credentials as shown below</p>
<pre><code class="lang-bash">nano conf/nifi.properties

<span class="hljs-comment"># security properties #</span>
nifi.sensitive.props.key=1w7wlN6OlK8PFLWRWLWqyc1+avR4GU/l
nifi.sensitive.props.algorithm=NIFI_PBKDF2_AES_GCM_256

nifi.security.autoreload.enabled=<span class="hljs-literal">false</span>
nifi.security.autoreload.interval=10 secs
nifi.security.keystore=./conf/nifi.keystore.p12 <span class="hljs-comment">#specify your path to the keystore certificate </span>
nifi.security.keystore.certificate=
nifi.security.keystore.privateKey=
nifi.security.keystoreType=PKCS12
nifi.security.keystorePasswd=thisismypass <span class="hljs-comment">#specify your password for the keystore from the previous step</span>
nifi.security.keyPasswd=thisismypass <span class="hljs-comment">#specify the same password as for the keystore</span>
nifi.security.truststore=./conf/nifi.truststore.p12 <span class="hljs-comment">#specify your path to the truststore certificate</span>
nifi.security.truststore.certificate=
nifi.security.truststoreType=PKCS12 <span class="hljs-comment">#specify the format</span>
nifi.security.truststorePasswd=thisismypass <span class="hljs-comment">#specify the password for the truststore certificate from the previous step</span>
</code></pre>
<h3 id="heading-as-additional-checks"><strong>As Additional Checks</strong></h3>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">If you are using a VM or a Kubernetes Cluster on Cloud, make sure to allow the port on the <strong>Inbound Rules</strong> on the VM, and on the Cloud’s Network (VPCs/VNet). Check the port mappings on the <strong>Kubernetes Services</strong> or <strong>Ingress Controllers</strong> in case of Kubernetes Clusters.</div>
</div>

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Make sure <code>ufw </code>or <code>firewalld </code>allow the ports on which the NiFi Server is running</div>
</div>

<h3 id="heading-restart-nifi-server"><strong>Restart NiFi Server</strong></h3>
<pre><code class="lang-bash">$ <span class="hljs-built_in">cd</span> &lt;nifi_directory&gt;
$ ./bin/nifi.sh restart
</code></pre>
<p>You should now be able to see the login page of NiFi</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745091763906/55edac18-49da-45c2-ac32-ae1c3c188736.jpeg" alt class="image--center mx-auto" /></p>
<p>In summary, troubleshooting NiFi SNI errors demands careful attention to configuration alignment between NiFi and intermediary systems, ensuring certificate validity and consistency, and employing systematic diagnostic techniques to navigate the TLS handshake process effectively.</p>
<p><strong>Encountered anything different? Share them with me in the comment section below!<br />If you liked the article, follow for more useful troubleshooting tips coming soon!</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745094561536/96cba71d-34d3-42fe-bd49-cb9e82c20a4b.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item></channel></rss>