<?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 Re: Active Gate Plugin can't access CA Certificates (python certifi) in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121115#M979</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://answers.dynatrace.com/users/20278/view.html" nodeid="20278"&gt;@Reinhard W.&lt;/A&gt; thanks for posting this!&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2021 23:45:15 GMT</pubDate>
    <dc:creator>ChadTurner</dc:creator>
    <dc:date>2021-02-17T23:45:15Z</dc:date>
    <item>
      <title>ActiveGate plugin can't access CA Certificates (Python certificate)</title>
      <link>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121113#M977</link>
      <description>&lt;P&gt;For those who might encounter this as well when writing their AG Remote Plugins a little hint.&lt;/P&gt;
&lt;P&gt;While building another plugin with dependencies to another library I was confronted with an error that the included urllib3 library of the remoteplugin environment couldn't load RooT CA certificates. The error in the plugin's log looked something like this:&lt;/P&gt;
&lt;PRE&gt;ERROR &amp;nbsp; [Python][15052339058944823227][Hostunit Consumption][140518812161792][ThreadPoolExecutor-0_2] - [set_full_status] (0)&lt;BR /&gt;Reason: SSLError&lt;BR /&gt;[Errno 2] No such file or directory&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;File "/opt/dynatrace/remotepluginmodule/agent/plugin/engine.zip/site-packages/urllib3/util/ssl_.py", line 319, in ssl_wrap_socket&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;context.load_verify_locations(ca_certs, ca_cert_dir)&lt;BR /&gt;FileNotFoundError: [Errno 2] No such file or directory&lt;/PRE&gt;
&lt;P&gt;After digging into it I found that the invoked external SSL connection required the root certificates that are typically shipped with urllib3 or certifi package. (both are included in the remoteplugin runtime environment). However the virtual (?) path would try to find the CA certificate package at this path:&lt;/P&gt;
&lt;PRE&gt;/opt/dynatrace/remotepluginmodule/agent/plugin/engine.zip/site-packages/certifi/cacert.pem&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;This is not a real path but points to the content of the site.zip archive. Python certifi gets this path by calling certifi.where() and urllib then fails to get the file, leading to this error.&lt;/P&gt;
&lt;P&gt;To resolve this issue I had to explicitly point my plugin to an "real" cacert.pem file in the AG's filesystem that is not within a zip file. I manually added ca cacert.pem file (which could be enahanced with corporate CA certs as well to my plugin directory:&lt;/P&gt;
&lt;PRE&gt;/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.missingmetrics/cacert.pem&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Just posting this here because I was pretty surprised to see this. Maybe it's a bug in the plugin runtime as well that can be fixed permanently as well...&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:01:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121113#M977</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2023-05-18T13:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Active Gate Plugin can't access CA Certificates (python certifi)</title>
      <link>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121114#M978</link>
      <description>&lt;P&gt;This is also how we've resolved this with extensions our services team has created for customers. I never dug into it as deep as you did with the root cause though. Thanks for sharing!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 09:21:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121114#M978</guid>
      <dc:creator>Mike_L</dc:creator>
      <dc:date>2021-01-29T09:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Active Gate Plugin can't access CA Certificates (python certifi)</title>
      <link>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121115#M979</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.dynatrace.com/users/20278/view.html" nodeid="20278"&gt;@Reinhard W.&lt;/A&gt; thanks for posting this!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 23:45:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/ActiveGate-plugin-can-t-access-CA-Certificates-Python/m-p/121115#M979</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2021-02-17T23:45:15Z</dc:date>
    </item>
  </channel>
</rss>

