<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Dockerized Secure NiFi Instance in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Dockerized-Secure-NiFi-Instance/m-p/286001#M212143</link>
    <description>&lt;P&gt;Solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;docker run --name nifi-ssl \
  -v /home/ec2-user/project/nifi-standalone/certs:/opt/certs \
  -v /home/ec2-user/project/nifi-standalone/conf:/opt/conf \
  -p 8080:8443 \
  -e NIFI_WEB_PROXY_HOST=11.111.111.111:8080 \
  -e AUTH=tls \
  -e KEYSTORE_PATH=/opt/certs/keystore.jks \
  -e KEYSTORE_TYPE=JKS \
  -e KEYSTORE_PASSWORD=passwordFROMnifi.properties  \
  -e TRUSTSTORE_PATH=/opt/certs/truststore.jks \
  -e TRUSTSTORE_PASSWORD=passwordFROMnifi.properties \
  -e TRUSTSTORE_TYPE=JKS \
  -e INITIAL_ADMIN_IDENTITY='CN=admin, OU=nifi' \
  -d \
  apache/nifi:latest&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 19 Dec 2019 09:40:43 GMT</pubDate>
    <dc:creator>maebert</dc:creator>
    <dc:date>2019-12-19T09:40:43Z</dc:date>
    <item>
      <title>Dockerized Secure NiFi Instance</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dockerized-Secure-NiFi-Instance/m-p/285936#M212100</link>
      <description>&lt;P&gt;&lt;SPAN class="GLIWNNXDBK"&gt;I have an EC2 instance running with the IPv4 Public IP &lt;/SPAN&gt;&lt;SPAN&gt;11.111.111.111.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The first thing I tried was to get NiFi running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;docker run --name nifi-standalone\
  -p 8080:8080 \
  -d \
  apache/nifi:latest&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;At 11.111.111.111.111:8080/nifi/ I can reach NiFi. Great.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I wanted to setup a secure NiFi instance.&lt;/P&gt;
&lt;P&gt;Step 1: Create certificates with the toolkit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;./bin/tls-toolkit.sh standalone -n '11.111.111.111' -C 'CN=admin,OU=nifi' -B SuperSecretPassword -o './standalone'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 2: Move keystore.jks and truststore.jks into a specific folder (here /home/ec2-user/project/nifi-standalone/certs).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scenario 1: set NIFI_WEB_HTTP_HOST&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run the following docker command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;docker run --name nifi-ssl \
  -v /home/ec2-user/project/nifi-standalone/certs:/opt/certs \
  -v /home/ec2-user/project/nifi-standalone/conf:/opt/conf \
  -p 8443:8443 \
  -e NIFI_WEB_HTTPS_HOST=11.111.111.111 \
  -e AUTH=tls \
  -e KEYSTORE_PATH=/opt/certs/keystore.jks \
  -e KEYSTORE_TYPE=JKS \
  -e KEYSTORE_PASSWORD=passwordFROMnifi.properties  \
  -e TRUSTSTORE_PATH=/opt/certs/truststore.jks \
  -e TRUSTSTORE_PASSWORD=passwordFROMnifi.properties \
  -e TRUSTSTORE_TYPE=JKS \
  -e INITIAL_ADMIN_IDENTITY='CN=admin,OU=nifi' \
  -d \
  apache/nifi:latest&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: I read the passwords for the keystore and truststore directly from the nifi.properties file that the toolkit creates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately the container shuts down because of&lt;/P&gt;
&lt;P&gt;2019-12-18 20:18:29,400 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.&lt;BR /&gt;java.io.IOException: Failed to bind to.../11.111.111.111:8443&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scenario 2: unset NIFI_WEB_HTTP_HOST&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run the following docker command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;docker run --name nifi-ssl \
  -v /home/ec2-user/project/nifi-standalone/certs:/opt/certs \
  -v /home/ec2-user/project/nifi-standalone/conf:/opt/conf \
  -p 8443:8443 \
  -e AUTH=tls \
  -e KEYSTORE_PATH=/opt/certs/keystore.jks \
  -e KEYSTORE_TYPE=JKS \
  -e KEYSTORE_PASSWORD=passwordFROMnifi.properties  \
  -e TRUSTSTORE_PATH=/opt/certs/truststore.jks \
  -e TRUSTSTORE_PASSWORD=passwordFROMnifi.properties \
  -e TRUSTSTORE_TYPE=JKS \
  -e INITIAL_ADMIN_IDENTITY='CN=admin,OU=nifi' \
  -d \
  apache/nifi:latest&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Now the jetty server starts:&lt;/P&gt;
&lt;P&gt;2019-12-18 20:34:23,104 INFO [main] org.apache.nifi.web.server.JettyServer NiFi has started. The UI is available at the following URLs:&lt;BR /&gt;2019-12-18 20:34:23,104 INFO [main] org.apache.nifi.web.server.JettyServer https://d592fc9f7974:8443/nifi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I saw the host d592fc9f7974 looks unexpected. https://d592fc9f7974:8443/nifi is unavailable.&amp;nbsp;Next attempt&amp;nbsp;&lt;A href="https://11.111.111.111:8443/nifi" target="_blank" rel="noopener"&gt;https://11.111.111.111:8443/nifi&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Result:&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;System Error&lt;/H1&gt;
&lt;H2&gt;The request contained an invalid host header [11.111.111.111:8443] in the request [/nifi]. Check for request manipulation or third-party intercept.&lt;/H2&gt;
&lt;P&gt;Valid host headers are [empty] or:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;127.0.0.1&lt;/LI&gt;
&lt;LI&gt;127.0.0.1:8443&lt;/LI&gt;
&lt;LI&gt;localhost&lt;/LI&gt;
&lt;LI&gt;localhost:8443&lt;/LI&gt;
&lt;LI&gt;[::1]&lt;/LI&gt;
&lt;LI&gt;[::1]:8443&lt;/LI&gt;
&lt;LI&gt;d592fc9f7974&lt;/LI&gt;
&lt;LI&gt;d592fc9f7974:8443&lt;/LI&gt;
&lt;LI&gt;172.17.0.2&lt;/LI&gt;
&lt;LI&gt;172.17.0.2:8443&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;IMG src=" " border="0" alt="" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 20:55:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dockerized-Secure-NiFi-Instance/m-p/285936#M212100</guid>
      <dc:creator>maebert</dc:creator>
      <dc:date>2019-12-18T20:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dockerized Secure NiFi Instance</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dockerized-Secure-NiFi-Instance/m-p/286001#M212143</link>
      <description>&lt;P&gt;Solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;docker run --name nifi-ssl \
  -v /home/ec2-user/project/nifi-standalone/certs:/opt/certs \
  -v /home/ec2-user/project/nifi-standalone/conf:/opt/conf \
  -p 8080:8443 \
  -e NIFI_WEB_PROXY_HOST=11.111.111.111:8080 \
  -e AUTH=tls \
  -e KEYSTORE_PATH=/opt/certs/keystore.jks \
  -e KEYSTORE_TYPE=JKS \
  -e KEYSTORE_PASSWORD=passwordFROMnifi.properties  \
  -e TRUSTSTORE_PATH=/opt/certs/truststore.jks \
  -e TRUSTSTORE_PASSWORD=passwordFROMnifi.properties \
  -e TRUSTSTORE_TYPE=JKS \
  -e INITIAL_ADMIN_IDENTITY='CN=admin, OU=nifi' \
  -d \
  apache/nifi:latest&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Dec 2019 09:40:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dockerized-Secure-NiFi-Instance/m-p/286001#M212143</guid>
      <dc:creator>maebert</dc:creator>
      <dc:date>2019-12-19T09:40:43Z</dc:date>
    </item>
  </channel>
</rss>

