<p>I mean, you absolutely can load the certificates and spin up a TLS server, but afaict there's no easy way to reload them once they are renewed. The documentation says that you must not change tls.Config. How would you do this?</p>
<hr/>**评论:**<br/><br/>nhooyr: <pre><p>There is a callback function <code>GetCertificate</code> in tls.Config</p></pre>captncraig: <pre><p>Yeah, I believe <a href="https://github.com/xenolf/lego">https://github.com/xenolf/lego</a> has an example for using their library this way.</p></pre>Vonney: <pre><p>I'd look at the source of Caddy.</p></pre>captncraig: <pre><p>Or use caddy as a proxy in front of your go app. That's what I do.</p></pre>fighterjet-biceps: <pre><p>I solved this problem by serving my app behind nginx. The problem of managing certs is made less painful and you're given access to nginx's excellent feature set for caching and load balancing.</p></pre>v1rous: <pre><p>Haven't taken the time to look into baking HTTPS into a go app. However, IMO an nginx proxy is the right tool for this job.</p></pre>pyratzu: <pre><p>I made package that will handle updated lets encrypt cents</p>
<p>go get -u github.com/CossackPyra/pyrahttp</p>
<p>pyrahttp.ListenAndServeLetsEncrypt(":7544",
"/home/user/cert/game01.example.com/fullchain.pem",
"/home/user/cert/game01.example.com/privkey.pem, nil)</p>
<p>Post in Russian language
<a href="https://habrahabr.ru/post/274749/" rel="nofollow">https://habrahabr.ru/post/274749/</a></p>
<p>I will try to make English post tomorrow.</p>
<p>I plan to release more code we use to handle lets encrypt in production with our game servers </p></pre>
