The apache plugin for the Let's Encrypt Python client can edit apache configuration files (one of the most complex and hard-to-get-right but also one of the most convenient features of the client). There is also an nginx plugin which is significantly more experimental and which also edits nginx configuration files.