News for hackers. Stuff that matters.
Re:GoDoc: package letsencrypt by zalmoxes on Tuesday September 20, 2016 @09:54AM (#12539477)
Also see https://godoc.org/golang.org/x/crypto/acme and https://github.com/xenolf/lego

Go has some of the best letsencrypt tooling out there, and there was even some support for merging ACME support directly into net/http https://github.com/golang/go/issues/17053

Re:GoDoc: package letsencrypt by zuzun on Tuesday September 20, 2016 @10:55AM (#12539972)
The developers working on the crypto/acme extension also wrote a stand-alone client: https://www.github.com/google/acme.

Very easy to use, can only recommend it!

Re:GoDoc: package letsencrypt by eternalban on Tuesday September 20, 2016 @11:07AM (#12540069)
rsc's code is using /acme from https://github.com/xenolf/lego (same thing?)
Re:GoDoc: package letsencrypt by eriknstr on Tuesday September 20, 2016 @02:46PM (#12542120)
I've been hosting my website using the https://github.com/diafygi/acme-tiny Python script running along with Nginx on a Raspberry Pi 1 Model B with reverse-proxy caching provided by CloudFlare from my home line for several months now. I have repo where I detail the setup and provide some config files and scripts.

I've been thinking about posting about it to HN but have not submitted it because

(a) Some of it might still be incomplete. Even though my website works perfectly, I don't remember if I've recorded absolutely everything that is needed or not.

(b) I have written a script to obtain the WAN IP from our router rather than using a 3rd party service. This is great for me because it means one less thing to worry about, but it also means that for others who are using different routers, their setup will require adjustments.

(c) Getting any attention on HN is hard. Submitted posts are most likely to gain a few couple upvotes before they quickly drown in the masses.

Anyway, since we were on the subject of other tools to use for Let's Encrypt, I figured I'd bring up acme-tiny, and when I had done so, I might as well mention all of the rest I said above.

Here's my write-up and related files: https://github.com/eriknstr/interweb

Re:GoDoc: package letsencrypt by mikecb on Tuesday September 20, 2016 @10:19AM (#12539677)
I just recently used lego for dns based issuance, and it was excellent.
Re:GoDoc: package letsencrypt by petre on Tuesday September 20, 2016 @02:06PM (#12541739)
True. I've tried 3 or 4 clients in Perl, Node.js. Only lego worked flawlessly. And the Caddy HTTP/2 webserver also has excellent ACME support.
Re:GoDoc: package letsencrypt by newman314 on Tuesday September 20, 2016 @10:43AM (#12539872)
+1 on lego. I'm a happy user.
Re:GoDoc: package letsencrypt by mholt on Tuesday September 20, 2016 @11:23AM (#12540209)
I'll be speaking about these various ACME packages for Go at dotGo next month. ACME is a little tricky, and each package has optimal use cases for best results.
Re:GoDoc: package letsencrypt by danielsamuels on Tuesday September 20, 2016 @11:52AM (#12540450)
Out of interest, is the built-in Go server what everyone uses for hosting their Go websites? I'm used to the typical Nginx / Gunicorn / Python stack and Python's built-in server is used for nothing more than development.
Re:GoDoc: package letsencrypt by technoweenie on Tuesday September 20, 2016 @11:54AM (#12540467)
We typically run go's built-in server behind nginx. There's no need for something like gunicorn in go.
Re:GoDoc: package letsencrypt by jensvdh on Tuesday September 20, 2016 @12:35PM (#12540828)
But this would not work in this set-up right? Wouldn't the user facing server (in your case Nginx) have to be the one that serves over HTTPS?

I'm a bit confused about this package.

Re:GoDoc: package letsencrypt by lopatin on Tuesday September 20, 2016 @04:00PM (#12542828)
I'm running a bare Go server behind CloudFlare.
Re:GoDoc: package letsencrypt by theqbit on Tuesday September 20, 2016 @10:12AM (#12539608)
There is also https://github.com/dkumor/acmewrapper

I like this one in particular, since it requires only a couple lines of code.

Re:GoDoc: package letsencrypt by aomix on Tuesday September 20, 2016 @03:53PM (#12542760)
There seem to be slightly fewer Lets Encrypt and ACME implementations than stars in the sky. Which is fantastic. Last week I read about a privsep/chroot/pledge'd (OpenBSD thing) C implementation https://kristaps.bsd.lv/acme-client/ .
Re:GoDoc: package letsencrypt by nabucodonosor on Tuesday September 20, 2016 @10:00AM (#12539524)
wondering why not using `defer m.mu.Unlock()` right after line 279: https://github.com/rsc/letsencrypt/blob/a18c646c3d0772313b7b...
Re:GoDoc: package letsencrypt by bouk on Tuesday September 20, 2016 @12:52PM (#12540964)
`defer` mostly makes sense when there's multiple exit paths (returns) or if there's a chance any of the code panics. Neither is the case in this instance, so just doing it like that is fine. There is also a slight overhead for deferring, as it needs to allocate some memory on the heap
Re:GoDoc: package letsencrypt by barpet on Tuesday September 20, 2016 @10:16AM (#12539639)
no reason imho..the function is pretty trivial. But also not a reason not to use it as a performance impact would be minimal :-)
Re:GoDoc: package letsencrypt by junke on Tuesday September 20, 2016 @10:46AM (#12539898)
The behavior is different if a panic occurs, isn't it? But is there any chance that this particular initialization code might panic in the first place?
Re:GoDoc: package letsencrypt by schmichael on Tuesday September 20, 2016 @12:33PM (#12540805)
Given the current code and no races against the values being initialized: no, there is no chance for a panic.
Re:GoDoc: package letsencrypt by alpb on Tuesday September 20, 2016 @01:57PM (#12541636)
This is not a good assumption. The code will panic, for instance when it can't allocate memory, or runs into signal handling issues.
Re:GoDoc: package letsencrypt by nabucodonosor on Tuesday September 20, 2016 @10:24AM (#12539736)
understood. thank you.
Re:GoDoc: package letsencrypt by Ianvdl on Tuesday September 20, 2016 @09:57AM (#12539496)
Here is the package on RSC's github page: https://github.com/rsc/letsencrypt
Re:GoDoc: package letsencrypt by dingdingdang on Tuesday September 20, 2016 @01:08PM (#12541098)
Does any of the code snippets on the godoc site constitute a fully working example? The sheer amount of library stuff I go through on a daily webdev basis makes me dizzy at times!
Re:GoDoc: package letsencrypt by ereyes01 on Tuesday September 20, 2016 @02:13PM (#12541812)
Your application likely uses more routes, and has other real work to do that won't be as brief as the example. However, the examples do work for me, and seem like a great place to start building up from.