<?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[Issues enabling https on RP 4]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I found myself working on my first Smart Mirror this week and I loved how easy it is to download new modules and have them running in no time.<br />
I was interested in enabling https by creating the certificates and changing the variable under config.js:</p>
<p dir="auto">useHttps: false -&gt; useHttps: true</p>
<p dir="auto">Nevertheless I only got a black screen afterwards.</p>
<p dir="auto">I tried everything I could think of, but, being that Im not much of a programmer, it basically meant hitting the keyboard with one hand while having another coffee hoping that would do it.</p>
<p dir="auto">Eventually, I managed to find out that I could connect to the <a href="https://localhost" target="_blank" rel="noopener noreferrer nofollow ugc">https://localhost</a>:port via a browser, which made me realise the keyboard-hitting works… and that it was running… just not with electron.</p>
<p dir="auto">Well, tonight, after many an hour in front of this, I was able to get it to work, so I can narrow it down to the following:</p>
<ul>
<li>Create your certificates correctly</li>
<li>Make sure you put the right address where they are located</li>
<li>Not enough coffee</li>
<li>There is a piece of code in electron.js that seems to be checking the wrong variable:</li>
</ul>
<p dir="auto">//	if (config[“tls”] !== null &amp;&amp; config[“tls”]) {<br />
if (config.useHttps) {<br />
prefix = “https://”;<br />
} else {<br />
prefix = “http://”;<br />
}</p>
<p dir="auto">The line in “//” was commented out by me. I couldnt find much of a reference to tls anywhere.</p>
<ul>
<li>Finally, as the certificate is self signed, these lines had to be added also to electron.js:</li>
</ul>
<p dir="auto">app.on(‘certificate-error’, (event, webContents, url, error, certificate,<br />
callback) =&gt; {<br />
event.preventDefault();<br />
callback(true);<br />
});</p>
<p dir="auto">I hope it helps someone else!</p>
<p dir="auto">Thanks<br />
Regards<br />
JP</p>
]]></description><link>https://forum.magicmirror.builders/topic/14091/issues-enabling-https-on-rp-4</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 09:49:23 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/14091.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Nov 2020 23:13:35 GMT</pubDate><ttl>60</ttl></channel></rss>