m-lab / ndt-server

docker native ndt5 and ndt7 server with prometheus integration
https://www.measurementlab.net/
Apache License 2.0
99 stars 40 forks source link

Add support for automatic TLS encryption via autocert #402

Closed robertodauria closed 4 months ago

robertodauria commented 4 months ago

This PR adds support for enabling TLS automatically via the autocert package. In particular, the two new flags -autocert.enabled and -autocert.hostname enable this feature. On the first HTTPS request, ndt-server will automatically try to get a certificate from LetsEncrypt, assuming the requested hostname matches what's in the -autocert.hostname file.

The reason for it being a file is that the in the BYOS scenario the hostname is generated by the autojoin register client and written to a file.

(FYI @nkinkade )


This change is Reviewable