<?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: NiFi SiteToSite HTTPS Provenance Reporting Task Issue - 401 Unauthorized in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396656#M249482</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/79092"&gt;@drewski7&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;While you added the public cert for your NiFi8444 to the truststore used in the nifi8443 StandardRestrictedSSLContetService, did you do the same in reverse?&lt;BR /&gt;&lt;BR /&gt;Does your StandardRestrictedSSLContetService also include the keystore?&amp;nbsp; The Keystore contains the PrivateKey that is used in the mutual TLS exchange with NiFi8444.&lt;BR /&gt;&lt;BR /&gt;NiFi8443's public cert (or complete trusts chain) needs to be added the truststore configured in the nifi.properties file on NiFi8444.&lt;BR /&gt;&lt;BR /&gt;You'll also want to look at the nifi-user.log on NiFi8444 to see the full exception thrown when NiFi8443 reporting tasks is trying to retrieve the Site-to-Site (S2S) details.&lt;BR /&gt;&lt;BR /&gt;Identities will be manipulated by matching identity mapping patterns setup in the nifi.properties file.&amp;nbsp; So you'll want to verify that also.&lt;BR /&gt;&lt;BR /&gt;Additionally, are you still using Single-User-provider on NiFI8444 along with the NiFi auto generated keystore and truststore?&amp;nbsp; (I saw CN=localhost in one of your images).&amp;nbsp; You should create a keystore and truststore with proper DN and SANs for use with S2S.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps with your investigation and troubleshooting.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2024 13:33:46 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2024-10-31T13:33:46Z</dc:date>
    <item>
      <title>NiFi SiteToSite HTTPS Provenance Reporting Task Issue - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396638#M249476</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two separate NiFi instance and I want to push provenance events from one instance to another. Source NiFi's hostname is nifi8443 and Target NiFi's hostname is nifi8444.&lt;/P&gt;&lt;P&gt;Both of these instances are running over HTTPS. On the "Target NiFi" I set up an input port called Test.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drewski7_0-1730335358762.png" style="width: 599px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42410iB1A2F5F1A01B4066/image-dimensions/599x319?v=v2" width="599" height="319" role="button" title="drewski7_0-1730335358762.png" alt="drewski7_0-1730335358762.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;On source NiFi, here's what my SiteToSiteProvenanceReportingTask looks like.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drewski7_1-1730335772677.png" style="width: 602px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42411i307458352EC163BF/image-dimensions/602x337?v=v2" width="602" height="337" role="button" title="drewski7_1-1730335772677.png" alt="drewski7_1-1730335772677.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's a couple things I did.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized that the reporting task on NiFi8443 is essentially acting like an client and NiFi8444 is acting as the server. I added the NiFi8444 server certificate into a truststore.p12 file on NiFi8443 and created the corresponding SSLContextService to point to that Truststore file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I resolved the SSL issue and then I was reading on the target node (ie. NiFi8444) I had to make an identity for the full DN of the source (ie NiFi8443) certificate. So on NiFI8444, I created a new user called this -&amp;nbsp;CN=nifi8443, O=NiFi Server, L=San Francisco, ST=California, C=US&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drewski7_2-1730337008918.png" style="width: 615px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42412i9D1D237735103400/image-dimensions/615x320?v=v2" width="615" height="320" role="button" title="drewski7_2-1730337008918.png" alt="drewski7_2-1730337008918.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I added that identity to two policies. The first one is &lt;STRONG&gt;retrieve-site-to-site&lt;/STRONG&gt; -&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drewski7_3-1730337264986.png" style="width: 609px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42413i27028764FBBCF49A/image-dimensions/609x338?v=v2" width="609" height="338" role="button" title="drewski7_3-1730337264986.png" alt="drewski7_3-1730337264986.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And the second one is the input port -&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drewski7_4-1730337463295.png" style="width: 696px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42414i53FB3A7315FEDB13/image-dimensions/696x388?v=v2" width="696" height="388" role="button" title="drewski7_4-1730337463295.png" alt="drewski7_4-1730337463295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I thought that was all the requirements however, I am currently getting this error when I start the reporting task.&amp;nbsp;&lt;/P&gt;&lt;DIV class="inline-flex flex-wrap gap-x-1.5"&gt;&lt;PRE&gt;SiteToSiteProvenanceReportingTask[id=d9ece17e-0192-1000-9050-2a4a5a2f9e02] Unable to refresh remote group peers due to: response code 401:Unauthorized with explanation: null&lt;/PRE&gt;&lt;P&gt;It seems like it has to do with the identity from NiFi8443 not properly being authenticated correctly. But when I run &lt;STRONG&gt;keytool -list -v -keystore nifi8443.p12&lt;/STRONG&gt; on the server certificate I get this -&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drewski7_5-1730338166215.png" style="width: 652px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42415iDDE8F7F70B828B2E/image-dimensions/652x282?v=v2" width="652" height="282" role="button" title="drewski7_5-1730338166215.png" alt="drewski7_5-1730338166215.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;- Do you know why I getting a 401 unauthorized error?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 31 Oct 2024 01:31:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396638#M249476</guid>
      <dc:creator>drewski7</dc:creator>
      <dc:date>2024-10-31T01:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi SiteToSite HTTPS Provenance Reporting Task Issue - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396656#M249482</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/79092"&gt;@drewski7&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;While you added the public cert for your NiFi8444 to the truststore used in the nifi8443 StandardRestrictedSSLContetService, did you do the same in reverse?&lt;BR /&gt;&lt;BR /&gt;Does your StandardRestrictedSSLContetService also include the keystore?&amp;nbsp; The Keystore contains the PrivateKey that is used in the mutual TLS exchange with NiFi8444.&lt;BR /&gt;&lt;BR /&gt;NiFi8443's public cert (or complete trusts chain) needs to be added the truststore configured in the nifi.properties file on NiFi8444.&lt;BR /&gt;&lt;BR /&gt;You'll also want to look at the nifi-user.log on NiFi8444 to see the full exception thrown when NiFi8443 reporting tasks is trying to retrieve the Site-to-Site (S2S) details.&lt;BR /&gt;&lt;BR /&gt;Identities will be manipulated by matching identity mapping patterns setup in the nifi.properties file.&amp;nbsp; So you'll want to verify that also.&lt;BR /&gt;&lt;BR /&gt;Additionally, are you still using Single-User-provider on NiFI8444 along with the NiFi auto generated keystore and truststore?&amp;nbsp; (I saw CN=localhost in one of your images).&amp;nbsp; You should create a keystore and truststore with proper DN and SANs for use with S2S.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps with your investigation and troubleshooting.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 13:33:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396656#M249482</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-10-31T13:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi SiteToSite HTTPS Provenance Reporting Task Issue - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396951#M249662</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The problem was my StandardRestrictedSSLContextService didn't include a keystore. For some reason, I thought it was just one way SSL communication. Once I added the keystore to the ContextService it was authenticating correctly! Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;!&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 14:02:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SiteToSite-HTTPS-Provenance-Reporting-Task-Issue-401/m-p/396951#M249662</guid>
      <dc:creator>drewski7</dc:creator>
      <dc:date>2024-11-04T14:02:57Z</dc:date>
    </item>
  </channel>
</rss>

