HTTPS is Easy
troyhunt.com
troyhunt.com
I mean, come on. Who honestly thinks "openssl pkcs12 -export -inkey httpsiseasy.key -in httpsiseasy.pem -name httpsiseasy -out httpsiseasy.pfx" looks easy? What the hell is pkcs12? What does export mean? what's a key, pem, and pfx? What the hell is going on here? Anyone can copy and paste random commands on a command-line, but that doesn't mean you have any idea what's going on, and when you have problems, you're totally lost.
I could tell people "programming is easy!", but it would be a misleading, stupid thing to say. Writing code may be easy, but actually making a well-written, well-supported, bug-free program that works reliably outside my own computer is damn hard.
If I want more people to feel comfortable programming, I'm not going to lie to them and tell them it's easy. I'm going to tell them the truth: that it's difficult, but that there are ways to ease into it and become more comfortable with it over time, and here are the ways to do that.
Please don't lie to people to push your agenda. It sucks for the people who then assume you're telling the truth, and try to do X, and then run into problems, and curse the people who misled them. I have been in this situation many times and it always sucks. If something is hard, just say so.
Specifically you've got a Private Key (which your servers need, but you mustn't show to anybody and so must be very careful to protect) and a Certificate (which is a public signed document and it's fine to show it to anybody, if you lose it you can just get another copy). Completely different security profiles so it makes sense to keep them separate even though you need both...
And then Microsoft says OK, let's use RSA's (the company not the algorithm) PKCS #12 to bundle these two items together into a PFX file. Now we've got a file that we'll call a "certificate" but in fact must be kept private at all times and not shown to anybody.
The worst thing about PFX / PKCS #12 is that as here you're usually going to see it because somebody skipped the vital step that actually makes any of Public Key security worth having. The Subject / Applicant should always generate their own keys. If you let the Certificate Issuer make the keys, the whole enterprise is basically a charade because instead of just acting as an Authority, now they're proxying for you entirely, if they want to impersonate you they can trivially do so at any time. Security goes out the window.
One of the great things about Let's Encrypt is that they illustrated that you can do this right (Let's Encrypt never sees your private keys, indeed if you mistakenly present them they'll revoke your certificate on the rationale that now the keys are revealed and the cert is worthless) without making the end user jump through technical hoops like typing in OpenSSL commands they don't understand. Your keys are made on your machine, but unless you care you don't need to know about it.
Troy wouldn't need this file, and thus this command, except that (as HN readers sometimes forget) he's a Microsoft MVP and so even when it's clearly the wrong choice he has to pimp the Microsoft approach if possible.
A better use of Troy's time as an MVP in _my_ opinion would have been to lobby Microsoft's IIS team to get ACME integration patched into recent releases ASAP‡. If this news item was "Troy's new video demos previously unannounced ACME integration for IIS 10" then it'd actually make an impact which this (unpaid) advertisement for Cloudflare does not.
‡ Bonus points since IIS is a commercial product, cut a deal to get your paying customers one free cert from a commercial CA using the new integration.
I don't see why HTTPS can't be both simple and in-house, examples like Caddy come to mind (not that I've used or am promoting that specific program).
If I say "HTTPS is easy", that's just false. There's no way for an average person to just figure out how to implement HTTPS by themselves. You need a special set of tools to be used in a certain way and you need to follow a guide with several steps, based on your unique use case. Or you can pay for a service to do it for you. Caddy may make things easy for some people, but some people won't be able to use it, and then HTTPS is hard again.
Can you learn how to do HTTPS, so that once you've done it a few times, it's easy for you? Sure! But the same goes for cleaning your clothes, writing a program, or even playing a piano. Do it enough times and it'll feel easy. That doesn't mean anyone can do it.
So, this is only true if you squint at the problem. In one sense Let's Encrypt is ISRG's Certificate Authority project, and it doesn't dice vegetables OR pick up dog hair. But the wider Let's Encrypt ecosystem does help you with lots of this:
* If you use Certbot (the hugely popular EFF maintained "reference" client for Let's Encrypt) with popular servers like Apache you get options to switch on HSTS and CSP: upgrade-insecure-requests
* If you use a bulk host, as a great many of Troy's target audience do, they either already have a single button push (easier than Cloudflare) "Get me free SSL" or they could but they've chosen for commercial reasons not to enable it (in the very popular CPanel a hosting company has to go out of their way to ensure this is disabled if they want to instead upsell customers to paid certs and squeeze a little more cash out). "Go to Cloudflare" and thereby centralise things even further is definitely the wrong choice in this scenario.
Thanks Troy!
"Thanks lbriner!"
Edit: Downvoters have spoken, and apparently the parent comment is the kind of content you guys want to see on this site. What a world.
"Web development is easy! (when you pay Squarespace)"
"Payment processing is easy! (when you pay Stripe)"
"Email is easy! (when you pay FastMail)"
This is nothing but a glorified ad for CloudFlare, and doesn't prove that HTTPS is "easy" but rather using CloudFlare's package offering is easier.
I like Troy Hunt, but this isn't one of his best.
Well... it is if you use Cloudflare. But yeah, it should be httpsiseasyIFusingcloudflare.com or something.
> This is nothing but a glorified ad for CloudFlare
It's technically not though. He says they didn't even know he was making this. It's just a nice little free resource for anyone using Cloudflare or looking for a relatively easy path to https. For him, it'll drive some traffic back to his other site and build his brand a bit more.
It'll probably result in a bunch of Cloudflare sites beefing up their security a bit and capture some who haven't previously tackled https at all. Isn't that a good thing?
Also, the article kinda covers this already:
> And before anyone loses their minds over the entire network not being encrypted or Cloudflare being able to MitM the traffic, have a read of CloudFlare, SSL and unhealthy security absolutism.
https://www.troyhunt.com/cloudflare-ssl-and-unhealthy-securi...
"Perfect is the enemy of good" is a legit problem we should avoid (i.e. not using HTTPS at all because CloudFlare isn't perfect) but the benefits and drawbacks should at least be discussed.
For example I think an insecure back-channel between your personal blog and CloudFlare is likely fine, but your eCommerce business, perhaps not.
Certbot isn't as universal as Cloudflare though, since you can't run it on a lot of shared hosting sites. It also requires a basic level of proficiency with the command line, which is unfortunately a bar a little too high for some users.
Sorry but when you lack all basic computer skills, you should _not_ be setting up TLS for a web server. No matter if you use Cloudflare or something else, have someone else do it.
(You are also trusting CloudFlare to generate the private key of your web server, which is no big deal if you are already using their services between you and the user, but might be more complicated if you decide to trust that cert for internal use.)
Ultimately I only recommend this if you want a fast fix to prevent public wifi operators from injecting stuff into your HTTP content. Any other use and you'll not be able to sleep at night wondering what kind of data CloudFlare has stored.
1. You may share a Cloudflare issued (deal with Comodo) cert with arbitrary other Cloudflare customers. This illustrates that only Cloudflare is ensuring your data isn't muddled with data from those other customers. But to be fair in reality this is true in all cases because of how Cloudflare actually works.
2. Your sites may get their own cert, only your names appear in the cert but it's still issued by Cloudflare using Comodo and isn't really "yours" in any sense.
3. You sort out certificates and Cloudflare uses the ones you provide for your sites.