TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Mkcert: Tool for making locally-trusted development certificates

218 pointsby vaibhavmulealmost 7 years ago

12 comments

tialaramexalmost 7 years ago
(All the below assumes I can read &#x27;Go&#x27;)<p>Nit picks about these certificates:<p>The certificates have a lifetime of 10 years starting from the exact moment they&#x27;re created. I suspect ten years is overkill, but I don&#x27;t see much real harm in it. However it&#x27;s common practice to set the notBefore into the recent past, this is because a variety of problems may cause clock drift. This is your development environment, so you _could_ fix any drift, but this sort of tool is all about productivity, so I think &quot;back dating&quot; by one day or even an hour to allow for drift would be a sound idea.<p>The EKU says TLS Server, I&#x27;d be tempted to throw TLS Client in there too. It would appear tempting to say anyUsage, but actually some peers will decide this is overbroad and reject your certificate so don&#x27;t do that. But having TLS Client might be nice if anybody is working on mutual authentication (both client and server present certificates, not very friendly for B2C apps but I like it in B2B).<p>The Key Usage says Key Encipherment and Digital Signature. Again it&#x27;s harmless in a development environment, but security-oriented live systems ought to contemplate removing Key Encipherment.<p>The only reason you&#x27;d need Key Encipherment in TLS is because you&#x27;re doing RSA key agreement, which means you aren&#x27;t getting Forward Secrecy by definition and you&#x27;re probably using some pretty rusty components. So it could make sense to spot that &quot;Oops, we&#x27;re trying to do RSA key agreement - why?&quot; in a development system before you ship it and discover you&#x27;re offering radically less security than you expected for some reason.
评论 #17751323 未加载
sebastiaandalmost 7 years ago
<p><pre><code> npx tlx-keygen </code></pre> - No installation required, npx comes with Node.js and downloads&#x2F;runs&#x2F;removes the package.<p>- Generate localhost certs with support for *.localhost, 127.0.0.1 (IPv4), ::1 (IPv6), etc.<p>- Register in operating system trust store (Win&#x2F;Lin&#x2F;Mac)<p>- Tested with major browsers (Chrome&#x2F;Firefox&#x2F;Safari&#x2F;Edge)<p><a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;tls-keygen" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;tls-keygen</a>
评论 #17748986 未加载
chatmastaalmost 7 years ago
I&#x27;ve been using minica [0] as recommended by letsencrypt [1] and am fairly happy with how easy it was to run and setup. I also like how small it is; I just embedded it in the development scripts of the project.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;jsha&#x2F;minica" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jsha&#x2F;minica</a><p>[1] <a href="https:&#x2F;&#x2F;letsencrypt.org&#x2F;docs&#x2F;certificates-for-localhost&#x2F;" rel="nofollow">https:&#x2F;&#x2F;letsencrypt.org&#x2F;docs&#x2F;certificates-for-localhost&#x2F;</a>
kodablahalmost 7 years ago
FYI, Windows support just got merged: <a href="https:&#x2F;&#x2F;github.com&#x2F;FiloSottile&#x2F;mkcert&#x2F;pull&#x2F;46" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;FiloSottile&#x2F;mkcert&#x2F;pull&#x2F;46</a>
FiloSottilealmost 7 years ago
Hello HN, author here! :)<p>Something I would love to collect some feedback on is: how would mkcert have to change, if at all, to support a production CA (for stuff like internal machines talking to each other)? Should it even try, or does a tool like minica do the trick there?<p>And please open an issue if it doesn’t just work on your dev machine!
ioquatixalmost 7 years ago
It&#x27;s funny how people seem to do the same thing at the same time. I recently made <a href="https:&#x2F;&#x2F;github.com&#x2F;socketry&#x2F;localhost" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;socketry&#x2F;localhost</a> however `mkcert` has lots of good ideas I&#x27;m going to &quot;borrow&quot; :)
评论 #17748799 未加载
beardicusalmost 7 years ago
I&#x27;ve had good luck with caman (<a href="https:&#x2F;&#x2F;github.com&#x2F;radiac&#x2F;caman" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;radiac&#x2F;caman</a>), but it doesn&#x27;t do any of the fancy certificate installation bits. This looks neat and useful.
评论 #17749659 未加载
naileralmost 7 years ago
No installation required: <a href="https:&#x2F;&#x2F;certsimple.com&#x2F;blog&#x2F;localhost-ssl-fix" rel="nofollow">https:&#x2F;&#x2F;certsimple.com&#x2F;blog&#x2F;localhost-ssl-fix</a><p>A few clicks and 1 actual command on macOS
评论 #17749260 未加载
vectorEQalmost 7 years ago
is there an advantage to this over using openssl or nss&#x2F;certutil commands?
评论 #17749026 未加载
评论 #17749168 未加载
tedchsalmost 7 years ago
For folks interested in the &quot;minimal&quot; aspect of this project, there is a similar one with a <i>single</i> Go file: <a href="https:&#x2F;&#x2F;github.com&#x2F;jsha&#x2F;minica" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jsha&#x2F;minica</a>
ausjkealmost 7 years ago
for embedded boxes golang is either unsupported there, or its binary is typical over-sized, a bash or C version of the same functionalities will be great there.<p>then you can have letsencrypt easily these days so probably we can use &#x27;official certificate&#x27; even for local development these days?
评论 #17750654 未加载
another-cuppaalmost 7 years ago
Emoji is unnecessary and annoying.