{"id":774,"date":"2020-09-27T17:29:10","date_gmt":"2020-09-27T15:29:10","guid":{"rendered":"http:\/\/jeedom.sigalou-domotique.fr\/?p=774"},"modified":"2024-05-23T07:01:16","modified_gmt":"2024-05-23T05:01:16","slug":"basculer-jeedom-en-https","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/basculer-jeedom-en-https","title":{"rendered":"Switch Jeedom to https"},"content":{"rendered":"<h2>Explanations, prerequisites<\/h2>\n<p>In this feedback, I use my <strong>DNS Reverse from Free<\/strong>. I imagine it is even easier to use a domain name, but with the functionality offered by Free, the domain is not indispensable.<\/p>\n<p>In the rest of this page, I will use the following reverse DNS: <strong>sigalou.hd.free.fr<\/strong>. Please note that this name is an example and does not exist; For security reasons, I do not give here the reverse DNS that I actually use.<\/p>\n<p>I have 3 Jeedoms installed on my local network:<\/p>\n<ul>\n<li>Jeedom Master in 192.168.0.100 (the main production Jeedom)<\/li>\n<li>Jeedom Slave in 192.168.0.21 (the Secondary Jeedom of Development)<\/li>\n<li>Jeedom Heating in 192.168.0.150 (a Jeedom dedicated to heating)<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-786\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/schema-ports-300x213.png\" alt=\"\" width=\"300\" height=\"213\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/schema-ports-300x213.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/schema-ports-600x427.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/schema-ports-768x546.png 768w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/schema-ports.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><!--more--><\/p>\n<p><strong>My goal is to access the 3 Jeedoms from outside via HTTPS.<\/strong><\/p>\n<p>So for example:<\/p>\n<ul>\n<li>https:\/\/sigalou.hd.free.fr:100<\/li>\n<li>https:\/\/sigalou.hd.free.fr:121<\/li>\n<li>https:\/\/sigalou.hd.free.fr:150<\/li>\n<\/ul>\n<h2>Generate the certificate on a Raspberry Pi OS<\/h2>\n<h3>Redirect all the flow from port 80<\/h3>\n<p>Before generating the certificate, you must redirect the entire stream from port 80 to the Raspberry in question.<\/p>\n<p>In the router (or box), add a port forwarding rule.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-775\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/toutleflux80-300x176.png\" alt=\"\" width=\"300\" height=\"176\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/toutleflux80-300x176.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/toutleflux80.png 502w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3>Generate certificate<\/h3>\n<p>You have to connect in SSH <em>(of 192.168.0.21 in this example)<\/em> Raspberry, then launch:<\/p>\n<p><em>Replace <strong>sigalou<\/strong> by your reverse DNS or adapt to your domain<\/em><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">sudo su cd \/etc\/ wget https:\/\/dl.eff.org\/certbot-auto chmod a+x certbot-auto .\/certbot-auto --apache -d sigalou.hd.free.fr<\/pre>\n<p>\u00a0<\/p>\n<div class=\"enlighter\">\n<div class=\"\">\n<div>\n<div><strong>Be careful, there are 2 dashes before apache!!!<\/strong><\/div>\n<div>\u00a0<\/div>\n<div>The certificate is generated on the Raspberry on 192.168.0.21<\/div>\n<div>\u00a0<\/div>\n<blockquote>\n<div>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>Congratulations! You have successfully enabled https:\/\/sigalou.hd.free.fr<br \/>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/div>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<h3>Recreate Port Redirection<\/h3>\n<div>If you have multiple Jeedoms on your reverse DNS, you must use the port to redirect to each device. So do not leave the redirect on 80, but redirect the port that selects your Jeedom <em>(:21,:100,:150 in the examples on this page)<\/em> from the domain name to port 443 of your Raspberry.<\/div>\n<div>\u00a0<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-781\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/443-300x174.png\" alt=\"\" width=\"300\" height=\"174\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/443-300x174.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/443.png 509w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/div>\n<h2>Result<\/h2>\n<div>If in this example, we call <strong>https:\/\/sigalou.hd.free.fr<\/strong>, we finally arrive on <strong>https:\/\/sigalou.hd.free.fr:121\/index.php?v=d<\/strong>, so on the good Raspberry that hosts the Jeedom.<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-782\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site-300x190.png\" alt=\"\" width=\"300\" height=\"190\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site-300x190.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site-600x380.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site-1024x649.png 1024w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site-768x487.png 768w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site.png 1043w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-784\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site2-300x166.png\" alt=\"\" width=\"300\" height=\"166\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site2-300x166.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2020\/09\/site2.png 473w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/div>\n<div>Your HTTPS access is validated by <span style=\"color: #339966;\">Let\u2019s Encrypt<\/span><\/div>\n<h2>And the other Jeedoms in the same network<\/h2>\n<div>Simply repeat the same procedure on each piece of equipment.<\/div>\n<h2>Renewal<\/h2>\n<div>To renew the certificate, after having clearly defined the port redirects, simply launch:<\/div>\n<div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">sudo certbot renew<\/pre>\n<p>On the command line<\/p>\n<blockquote>\n<p>root@maitre:\/etc# sudo certbot renew<br \/>Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log<\/p>\n<p>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>Processing \/etc\/letsencrypt\/renewal\/peres.hd.free.fr.conf<br \/>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>Renewing an existing certificate for peres.hd.free.fr<br \/>Reloading apache server after certificate renewal<\/p>\n<p>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<br \/>Congratulations, all renewals certified:<br \/>\/etc\/letsencrypt\/live\/peres.hd.free.fr\/fullchain.pem (successful)<br \/>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/p>\n<\/blockquote>\n<\/div>\n<h2>References, Bibliography<\/h2>\n<div>\u00a0<\/div>\n<ul>\n<li><a href=\"https:\/\/jeedomiser.fr\/article\/acceder-a-jeedom-depuis-lexterieur-et-en-https-avec-lets-encrypts-sur-son-raspberry-pi\/\">https:\/\/jeedomiser.fr\/article\/acceder-a-jeedom-depuis-lexterieur-et-en-https-avec-lets-encrypts-sur-son-raspberry-pi\/<\/a><\/li>\n<li><a href=\"https:\/\/easydomoticz.com\/forum\/viewtopic.php?t=4702&amp;start=30\">https:\/\/easydomoticz.com\/forum\/viewtopic.php?t=4702&amp;start=30<\/a><\/li>\n<li>\u00a0<\/li>\n<\/ul>\n<div>\u00a0<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>Explanations, prerequisites In this feedback, I use my DNS Reverse from Free. I imagine it is even easier to use a domain name, but with the functionality offered by Free, the domain is not indispensable. In the rest of this page, I will use the following reverse DNS: sigalou.hd.free.fr. Please note that this name is a [...]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,23],"tags":[],"class_list":["post-774","post","type-post","status-publish","format-standard","hentry","category-domotique","category-jeedom-2"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/comments?post=774"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/774\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}