Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Add Auto-HTTPS #1113

Open
bscott opened this issue Jun 16, 2018 · 9 comments
Open

Add Auto-HTTPS #1113

bscott opened this issue Jun 16, 2018 · 9 comments
Labels
enhancement New feature or request help wanted Feel free to contribute! s: triage Some tests need to be run to confirm the issue
Milestone

Comments

@bscott
Copy link

bscott commented Jun 16, 2018

Add support for automatic TLS with LetsEncrypt using custom server.

@robbyoconnor
Copy link
Contributor

In most cases, won't your app sit behind a reverse proxy/load balancer?

@stanislas-m
Copy link
Member

@robbyoconnor In most cases, yes. But prod setups are not all the same, so we should help in those cases too. :)

@stanislas-m stanislas-m added the enhancement New feature or request label Jun 18, 2018
@robbyoconnor
Copy link
Contributor

robbyoconnor commented Jun 18, 2018 via email

@bscott
Copy link
Author

bscott commented Jun 20, 2018

Trying to think how to approach a PR for this. Wondering if buffalo new should take an argument to enable Auto TLS?, Any ideas how we would support this?

Example client:
https://godoc.org/golang.org/x/crypto/acme/autocert

@robbyoconnor
Copy link
Contributor

robbyoconnor commented Jun 20, 2018 via email

@markbates
Copy link
Member

markbates commented Jun 20, 2018 via email

@stanislas-m stanislas-m added the help wanted Feel free to contribute! label Jun 9, 2019
@hdm
Copy link
Contributor

hdm commented Aug 9, 2019

Some example code for this if anyone is interested in making it official: https://gist.github.com/hdm/d271eb94a51f7f908ecb9ddc82d2b644

@dschulz
Copy link

dschulz commented Nov 20, 2019

Just my 2 cents: CertMagic is a fine option.

@hut8
Copy link
Contributor

hut8 commented Apr 26, 2022

I used https://gist.github.com/hdm/d271eb94a51f7f908ecb9ddc82d2b644 today and it worked perfectly. Big fan of that. Thanks, @hdm ! I'm trying to integrate this into buffalo itself. As far as I can tell, the contents of that gist wouldn't actually need to be generated and put into one's project, it seems like Buffalo could just run this instead of the other code to generate the "servers.Server" if an environment variable or YAML config says so. Thoughts on implementation?

My only concern would be this:
If you have your buffalo app running on several servers, and the cert cache directory isn't shared, each app will attempt to get its own LetsEncrypt cert. Maybe this is a documentation issue mostly. Also, when deployed in a container, the place that the certs are stored needs to be configured separately in a volume somewhere. Likewise, if you have N webservers, and the directory is shared, then if they are all deployed simultaneously, they will still attempt to obtain N certificates simultaneously which is probably bad (I am not a letsencrypt expert so maybe this isn't even a problem).

@sio4 sio4 added the s: triage Some tests need to be run to confirm the issue label Sep 26, 2022
@sio4 sio4 modified the milestones: Proposal, Backlog Sep 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Feel free to contribute! s: triage Some tests need to be run to confirm the issue
Projects
None yet
Development

No branches or pull requests

8 participants