<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to disable SSL check in python Request]]></title><description><![CDATA[<p dir="auto">Hi, guys.<br />
Hope i’m posting this on the right place.</p>
<p dir="auto">I’ll try to be as clear as possible.</p>
<p dir="auto">I have a Home Assistant on the same raspberry pi as my Magic Mirror. And I use MMM-HASS module (<a href="https://github.com/aserramonner/MMM-HASS" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/aserramonner/MMM-HASS</a>) to see the state of a few sensor on my Home Assistant (light, temperature, etc).</p>
<p dir="auto">I use my Home Assistant with a DuckDNS dns (<a href="http://xxxxx.duckdns.org" target="_blank" rel="noopener noreferrer nofollow ugc">xxxxx.duckdns.org</a>) with Lets Encrypt SSL and everything worked fine, until I changed my router.</p>
<p dir="auto">My new router doesnt support a feature called NAT Loopback, that is:<br />
If I am outside my LAN (for example acessing from may phone 4G) I can access my home assistant with <a href="http://xxx.duckdns.org" target="_blank" rel="noopener noreferrer nofollow ugc">xxx.duckdns.org</a>.<br />
But if I am INSIDE my LAN (for example from my PC) I can’t access with <a href="http://xxx.duckdns.org" target="_blank" rel="noopener noreferrer nofollow ugc">xxx.duckdns.org</a>. I can only access it with the raspberry pi IP itself: 192.168.X.X.</p>
<p dir="auto">The thing is, these modules that integrate with home assistant with magic mirror (like MMM-HASS and MMM-homeassistant-sensors) expect a “host” variable.</p>
<p dir="auto">Since the MagicMirror is inside my LAN I have to access it with 192.168.X.X, but since I have a SSL encryption for <a href="http://xxx.duckdns.org" target="_blank" rel="noopener noreferrer nofollow ugc">xxx.duckdns.org</a>, the magic mirror module get the connection error: “Hostname/IP does not match certificate’s altnames: IP: 192.168.X.X is not in the cert’s list:”</p>
<p dir="auto">With my old router I set the “host” variable to <a href="http://xxx.duckdns.org" target="_blank" rel="noopener noreferrer nofollow ugc">xxx.duckdns.org</a>. But since my new router doesn’t have this “NAT Loopback” thing, I have to set my LAN IP.</p>
<p dir="auto">The solution is: I have to set these modules so they doesnt check the SSL. The Python “Request” has this option: verify=False, as I saw here: <a href="https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests</a></p>
<p dir="auto">But my knowledge in Python is null. So, can anyone help me setting this “verify=False” parameter in the PYthon HTTP Request?</p>
<p dir="auto">I tried editing this file “~/MagicMirror/modules/MMM-HASS/node_helper.js”, but I couldnt edit it the right way. I assume it is around these lines of code:</p>
<pre><code>request(get_options, function(error, response, body) {
          completed_requests++;
          if(config.debuglogging) {
            console.log(error);
            console.log(body);
          }
          outDevice[body.entity_id] = body.state;
          if (completed_requests == urls.length) {
            // All requests done for the device, process responses array
            // to retrieve all the states
            outDevice.label = device.deviceLabel;
            console.log(outDevice);
            callback(outDevice);
          }
        });
</code></pre>
<p dir="auto">but I couldnt get it right.<br />
I tried changing the “get_options” var from</p>
<pre><code>var get_options = {
          url: urls[i],
          json: true
        };
</code></pre>
<p dir="auto">to</p>
<pre><code>var get_options = {
          url: urls[i],
          json: true,
          verify: false
        };
</code></pre>
<p dir="auto">but no success either.</p>
<p dir="auto">Hope I made myself clear, and thanks in advance!</p>
]]></description><link>https://forum.magicmirror.builders/topic/10121/how-to-disable-ssl-check-in-python-request</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 12:23:38 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/10121.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Mar 2019 00:02:07 GMT</pubDate><ttl>60</ttl></channel></rss>