<?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: How to access kerberos NIFI cluster with nifi api of python https in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113908#M46837</link>
    <description>&lt;P&gt;According to &lt;A target="_blank" href="https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection"&gt;Python documentation&lt;/A&gt;, using key_file and cert_file is deprecated, they recommend you pass in a context (one that has been configured by calling &lt;A target="_blank" href="https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_cert_chain"&gt;load_cert_chain&lt;/A&gt;). You'll need a certfile and a keyfile there too, which you can get using various openssl commands (assuming you have openssl installed). For example, to export a client secret key from a PKCS12 keystore to a PEM file:&lt;/P&gt;&lt;PRE&gt;openssl pkcs12 -in CN=&amp;lt;something_you_typed&amp;gt;_OU=Apache NiFi.p12 -nodes -nocerts -out client.key&lt;/PRE&gt;&lt;P&gt;Or to export a server private key from a JKS keystore to a PEM file:&lt;/P&gt;&lt;PRE&gt;keytool -importkeystore -srckeystore &amp;lt;keystore.jks&amp;gt; -destkeystore keystore.p12 -deststoretype PKCS12

openssl pkcs12 -in keystore.p12 -nodes -nocerts -out nifi.key&lt;/PRE&gt;&lt;P&gt;Or to export a CA cert from a JKS keystore to a PEM file:&lt;/P&gt;&lt;PRE&gt;keytool -export -alias &amp;lt;your_alias&amp;gt; -file ca.der -keystore &amp;lt;truststore.jks&amp;gt;

openssl x509 -inform der -in ca.der -out ca.pem&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Nov 2016 23:14:43 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2016-11-21T23:14:43Z</dc:date>
    <item>
      <title>How to access kerberos NIFI cluster with nifi api of python https</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113907#M46836</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;    We have a kerberos enabled FDT cluster,  I want to access the nifi api through https of python. But I cannot got it.&lt;/P&gt;&lt;P&gt;I don't know how to put the parameter, self.key, and self.cert:  how to get the private key, and the certificate chain.&lt;/P&gt;&lt;PRE&gt; httplib.HTTPSConnection(host,key_file=self.key,cert_file=self.cert,timeout=timeout)
&lt;/PRE&gt;&lt;P&gt; there is my https config&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/9672-nifi-cofig.png"&gt;nifi-cofig.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Could you give me  any point. Thanks.&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 20:49:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113907#M46836</guid>
      <dc:creator>Paul Yang</dc:creator>
      <dc:date>2016-11-21T20:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to access kerberos NIFI cluster with nifi api of python https</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113908#M46837</link>
      <description>&lt;P&gt;According to &lt;A target="_blank" href="https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection"&gt;Python documentation&lt;/A&gt;, using key_file and cert_file is deprecated, they recommend you pass in a context (one that has been configured by calling &lt;A target="_blank" href="https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_cert_chain"&gt;load_cert_chain&lt;/A&gt;). You'll need a certfile and a keyfile there too, which you can get using various openssl commands (assuming you have openssl installed). For example, to export a client secret key from a PKCS12 keystore to a PEM file:&lt;/P&gt;&lt;PRE&gt;openssl pkcs12 -in CN=&amp;lt;something_you_typed&amp;gt;_OU=Apache NiFi.p12 -nodes -nocerts -out client.key&lt;/PRE&gt;&lt;P&gt;Or to export a server private key from a JKS keystore to a PEM file:&lt;/P&gt;&lt;PRE&gt;keytool -importkeystore -srckeystore &amp;lt;keystore.jks&amp;gt; -destkeystore keystore.p12 -deststoretype PKCS12

openssl pkcs12 -in keystore.p12 -nodes -nocerts -out nifi.key&lt;/PRE&gt;&lt;P&gt;Or to export a CA cert from a JKS keystore to a PEM file:&lt;/P&gt;&lt;PRE&gt;keytool -export -alias &amp;lt;your_alias&amp;gt; -file ca.der -keystore &amp;lt;truststore.jks&amp;gt;

openssl x509 -inform der -in ca.der -out ca.pem&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Nov 2016 23:14:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113908#M46837</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-11-21T23:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to access kerberos NIFI cluster with nifi api of python https</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113909#M46838</link>
      <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;For me I cannot got the first step of client secret key, there is not CN&amp;lt;something_you_typed&amp;gt;_OU=ApacheNiFi.p12&lt;/P&gt;&lt;P&gt;file , I just do the second step : &lt;/P&gt;&lt;PRE&gt;keytool -importkeystore -srckeystore &amp;lt;keystore.jks&amp;gt; -destkeystore keystore.p12 -deststoretype PKCS12
openssl pkcs12 -in keystore.p12 -out nifi-01.pem -nodes
&lt;/PRE&gt;&lt;P&gt;So I put the nifi-01.pem to :&lt;/P&gt;&lt;PRE&gt;conn=httplib.HTTPSConnection('nifi-test01.beta1.fn', 9091, key_file=None, cert_file="nifi-01.pem")
&lt;/PRE&gt;&lt;P&gt;and it works. &lt;/P&gt;&lt;P&gt;BTW ,  I really don't need to put username and password and I can access the rest get api. &lt;/P&gt;&lt;P&gt;Of course, I did not to use post or delete api, is it the correct behavior?&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 15:00:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-access-kerberos-NIFI-cluster-with-nifi-api-of-python/m-p/113909#M46838</guid>
      <dc:creator>Paul Yang</dc:creator>
      <dc:date>2016-11-22T15:00:10Z</dc:date>
    </item>
  </channel>
</rss>

