See this for inspiration: https://github.com/kristapsdz/acme-client
Some other web servers have gone and implemented a fully automatic LetsEncrypt engine in their codebase. This makes it incredibly easy and convenient to use SSL for free using LetsEncrypts services.