<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Https on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/https/</link><description>Recent content in Https on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Mon, 18 Mar 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/https/index.xml" rel="self" type="application/rss+xml"/><item><title>Certbot - removing a domain</title><link>https://blog.iankulin.com/certbot-removing-a-domain/</link><pubDate>Mon, 18 Mar 2024 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/certbot-removing-a-domain/</guid><description>&lt;p&gt;I had a number of domains all running on one host when I first set them up with certbot. One started to be serious, so I moved it to another host and ran certbot there. That all worked perfectly, but of course, the old domain is still part of the original certificate, so when I went to renew it, it came up with some errors.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a few commands that are going to help navigate this situation if you&amp;rsquo;ve found yourself in the same spot:&lt;/p&gt;
&lt;h4 id="show-all-certificates-and-which-domains"&gt;Show all certificates and which domains&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo certbot certificates
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="renew-just-some-domains"&gt;Renew just some domains&lt;/h4&gt;
&lt;p&gt;There&amp;rsquo;s no way to delete a domain from a certificate, the process is to renew it, but just for the domains you want to keep. Certbot will notice you&amp;rsquo;ve missed some and warn you that you&amp;rsquo;re effectively deleting them.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo certbot --cert-name &amp;lt;certifcate-name&amp;gt; -d &amp;lt;domain1&amp;gt; -d &amp;lt;domain-2&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Certbot &amp; Let's Encrypt are great</title><link>https://blog.iankulin.com/certbot-lets-encrypt-are-great/</link><pubDate>Thu, 12 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/certbot-lets-encrypt-are-great/</guid><description>&lt;img src="https://blog.iankulin.com/images/certbot.png" width="847" alt=""&gt;
&lt;p&gt;I&amp;rsquo;ve been managing SSL certificates for my domains purchased from &lt;a href="https://porkbun.com/"&gt;PorkBun&lt;/a&gt; by going there every 90 days downloading the certificates, &lt;a href="https://blog.iankulin.com/installing-ssl-certificates-with-nginx-on-docker/"&gt;joining them together&lt;/a&gt; to make the &lt;code&gt;fullchain.pem&lt;/code&gt; then &lt;code&gt;scp&lt;/code&gt;-ing them to my servers. That&amp;rsquo;s been sort of manageable, but less than ideal.&lt;/p&gt;
&lt;p&gt;It also doesn&amp;rsquo;t work for my Australian domains. Since there&amp;rsquo;s strict rules about who can own a domain in the &lt;code&gt;.au&lt;/code&gt; space (&lt;em&gt;you have to have some sort of right to the name - a random person can&amp;rsquo;t obtain the &lt;code&gt;coke.com.au&lt;/code&gt; domain unless that&amp;rsquo;s a trading name, a trademark, or something similar&lt;/em&gt;), they have to be managed by one of about eight organisations, and the offerings are much simpler.&lt;/p&gt;
&lt;p&gt;No problem though for two wonderful reasons - &lt;a href="https://letsencrypt.org/"&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; and &lt;a href="https://certbot.eff.org/"&gt;Certbot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the Internet Security Research Group. They provide free TLS certificates to allow websites to use SSL.&lt;/p&gt;
&lt;p&gt;Certbot, managed by the Electronic Frontiers Foundation, is a utility to automatically obtain certificates for a website from Let&amp;rsquo;s Encrypt, and change the server configuration files to use them.&lt;/p&gt;
&lt;p&gt;This makes this whole process amazingly painless. There&amp;rsquo;s really no excuse for not adding this to your websites, and I&amp;rsquo;d highly encourage you to donate to both projects if you use Certbot.&lt;/p&gt;
&lt;h2 id="certbot"&gt;Certbot&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;m running NGINX on Ubuntu LTS on my VPS&amp;rsquo;s, so installation was a snap (pun intended). I just followed the &lt;a href="https://certbot.eff.org/instructions?ws=nginx&amp;amp;os=ubuntufocal"&gt;instructions&lt;/a&gt; which involved installing the snap, adding a symlink to ensure it was in my path, then running the bot passing it a flag to say I was using NGINX.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-09-02-at-4.35.25-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-09-02-at-4.35.25-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It asks you a couple of questions, intelligently (by reading all the nginx conf files) then downloads the certificates and edits the nginx site conf files to use them. It also adds a systemd timer command to automate checking to see if they need renewed every couple of hours.&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s done, you just go back to your website and you&amp;rsquo;ve got the magical padlock, and won&amp;rsquo;t have to worry about it again due to the automatic renewal.&lt;/p&gt;</description></item><item><title>Save Proxmox password in Chrome</title><link>https://blog.iankulin.com/save-proxmox-password-in-chrome/</link><pubDate>Sat, 11 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/save-proxmox-password-in-chrome/</guid><description>&lt;p&gt;When I installed Proxmox, I&amp;rsquo;d used a secure, and therefore absurdly long and complicated root password. I do use a password manager, but don&amp;rsquo;t have it integrated into Chrome, so it was buggging me having to find it and paste it in each time - why wasn&amp;rsquo;t Chrome offering to save it for me?&lt;/p&gt;
&lt;p&gt;Well, you&amp;rsquo;d guess it was something to do with this. I feel like Chrome is trying to tell me something here:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.06.49-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Seems like a certificate thing. &lt;a href="https://forum.proxmox.com/threads/how-can-i-save-pve-web-loginpassword-on-firefox-chrome.46180/"&gt;These peeps&lt;/a&gt; say that I need to import the CA from PVE, and one more &lt;a href="https://pve.proxmox.com/wiki/Import_certificate_in_browser"&gt;googlestep reveals&lt;/a&gt; the certificate is on the Proxmox machine at &lt;code&gt;/etc/pve/pve-root-ca.pem&lt;/code&gt; so we need to grab that.&lt;/p&gt;
&lt;img src="https://blog.iankulin.com/images/aint.jpg" width="90" alt=""&gt;
&lt;p&gt;A while ago, I wrote a post about &lt;a href="https://blog.iankulin.com/copying-a-file-via-ssh/"&gt;using scp to copy files over ssh&lt;/a&gt;, and you should totally know how to do that, but my daily drive for secure file copying is now &lt;a href="https://filezilla-project.org/"&gt;filezilla&lt;/a&gt;. Once you have a bundle of servers in VM&amp;rsquo;s and containers that you revisit and move stuff around all the time, its just a big productivity step-up to have that list of hosts and credentials a tap away, plus having the visual arrangement of nested folders works for my brain somehow.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.14.40-am-1.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;On Mac, certificates need to live in the KeyChain, so you just drag the file into the certificates page. But it won&amp;rsquo;t be trusted, so you need to go in and manually do that. Where it says &amp;ldquo;Use System Defaults&amp;rdquo; change it to &amp;ldquo;Always Trust&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.19.54-am-1.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It was annoying at this stage to find that Chrome was still saying it was insecure - even though it had changed to saying the certificate was valid.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.20.50-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Looking at the settings for the site in Chrome, there&amp;rsquo;s an option for &amp;ldquo;Insecure Content&amp;rdquo; I try changing that to &amp;ldquo;Allow&amp;rdquo;, but really I&amp;rsquo;m guessing by this stage.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.21.15-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;But it actually does help - I&amp;rsquo;ve got the little padlock. That wasn&amp;rsquo;t quite the end since Chrome still wasn&amp;rsquo;t offering to save the password, but clearing the cache fixed that.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.24.08-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.24.08-am.png" width="566" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>APIs - http &amp; https Mixed Content error</title><link>https://blog.iankulin.com/apis-http-https-mixed-content-error/</link><pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/apis-http-https-mixed-content-error/</guid><description>&lt;p&gt;&amp;lt;img src=&amp;quot;/images/screen-shot-2023-01-16-at-4.45.53-pm.jpg alt=&amp;ldquo;Mixed Content: The page at &amp;lsquo;&lt;URL&gt;&amp;rsquo; was loaded over HTTPS, but requested an insecure resource '&lt;/p&gt;
&lt;p&gt;Ran into a little bump today - I was calling a &lt;a href="http://open-notify.org/Open-Notify-API/ISS-Location-Now/"&gt;cool API&lt;/a&gt; that gives the current location of the International Space Station. In a classic case of &amp;ldquo;it worked on my machine&amp;rdquo; it worked perfectly in the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer"&gt;Live server&lt;/a&gt; in VS Code on my laptop, but when I pushed it up to my GitHub space, it didn&amp;rsquo;t work - throwing the error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;script&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;js&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;5&lt;/span&gt; Mixed Content&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; The page at &lt;span style="color:#a3be8c"&gt;&amp;#39;https://iankulin.github.io/iss/index.html&amp;#39;&lt;/span&gt; was loaded over HTTPS&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; but requested an insecure resource &lt;span style="color:#a3be8c"&gt;&amp;#39;http://api.open-notify.org/iss-now.json&amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt; This request has been blocked&lt;span style="color:#eceff4"&gt;;&lt;/span&gt; the content must be served over HTTPS&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It turns out, as a security measure, it&amp;rsquo;s not possible for a page served under an SSL certificate to call a non-secure endpoint. This makes sense since a user would be reassured by a https page knowing no data was being leaked in the URL or other calls - but if this could be circumvented by some JavaScript that would be bad.&lt;/p&gt;
&lt;p&gt;It worked fine on my machine since it it was being served as http and calling an http api, but when I pushed it up to GitHub Pages (which is https) I ran into the error.&lt;/p&gt;
&lt;p&gt;I tried changing the API call to https, but unfortunately that server doesn&amp;rsquo;t have the SSL certificate in place to allow that. I also tried requesting the whole page from GitHub Pages as http, but it won&amp;rsquo;t allow that. Googling around, there does not seem to be any way to disable this (which makes sense).&lt;/p&gt;
&lt;p&gt;Luckily, I found another api &lt;a href="https://wheretheiss.at/w/developer"&gt;wheretheiss.at&lt;/a&gt; which does allow https, so crisis averted.&lt;/p&gt;</description></item></channel></rss>