<?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>topic Using httplib.HTTPSConnection with keystore pass phrase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-httplib-httpsconnection-with-keystore-pass/m-p/383094#M30177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using ArcGIS 10.0 with Python 2.6.5.&amp;nbsp; This is not a ArcGIS-related Python question, but just a Python question.&amp;nbsp; Hopefully that is okay and someone will still know this.&amp;nbsp; In our application, once the user has selected an AOI and we do a spatial search on our file geo-database, we get some URLs for files that we want to download.&amp;nbsp; We used to use urllib.urlretrieve but now the target site has been SSL-enabled and requires a certificate.&amp;nbsp; Our requests are coming from the server and we have a signed server cert along with the private key file.&amp;nbsp; The key file has an associated PEM pass phrase and I am trying to figure out how to include the pass phrase in the connection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a note, I can bypass the pass phrase thing by creating a new private key PEM file with no pass phrase and then using....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;httplib.HTTPSConnection(host, key_file="privatekey.pem", cert_file="public.pem")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and all works fine.&amp;nbsp; If, however, the key file contains a PEM pass phrase, I am prompted for it on the command line.&amp;nbsp; I am trying to find a way to include the pass phrase in the connection (or elsewhere).&amp;nbsp; I have read about the newer SSLContext objects, specifically the load_cert_chain method that allows for a password parameter, but that is not available in Python 2.6.5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if what I am looking for is possible using our version of Python?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 17:58:33 GMT</pubDate>
    <dc:creator>PeterLen</dc:creator>
    <dc:date>2015-06-10T17:58:33Z</dc:date>
    <item>
      <title>Using httplib.HTTPSConnection with keystore pass phrase</title>
      <link>https://community.esri.com/t5/python-questions/using-httplib-httpsconnection-with-keystore-pass/m-p/383094#M30177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using ArcGIS 10.0 with Python 2.6.5.&amp;nbsp; This is not a ArcGIS-related Python question, but just a Python question.&amp;nbsp; Hopefully that is okay and someone will still know this.&amp;nbsp; In our application, once the user has selected an AOI and we do a spatial search on our file geo-database, we get some URLs for files that we want to download.&amp;nbsp; We used to use urllib.urlretrieve but now the target site has been SSL-enabled and requires a certificate.&amp;nbsp; Our requests are coming from the server and we have a signed server cert along with the private key file.&amp;nbsp; The key file has an associated PEM pass phrase and I am trying to figure out how to include the pass phrase in the connection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a note, I can bypass the pass phrase thing by creating a new private key PEM file with no pass phrase and then using....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;httplib.HTTPSConnection(host, key_file="privatekey.pem", cert_file="public.pem")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and all works fine.&amp;nbsp; If, however, the key file contains a PEM pass phrase, I am prompted for it on the command line.&amp;nbsp; I am trying to find a way to include the pass phrase in the connection (or elsewhere).&amp;nbsp; I have read about the newer SSLContext objects, specifically the load_cert_chain method that allows for a password parameter, but that is not available in Python 2.6.5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if what I am looking for is possible using our version of Python?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:58:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-httplib-httpsconnection-with-keystore-pass/m-p/383094#M30177</guid>
      <dc:creator>PeterLen</dc:creator>
      <dc:date>2015-06-10T17:58:33Z</dc:date>
    </item>
  </channel>
</rss>

