The key part of the log is the above error. The 522 error is a problem of the Cloudflare CDN Edge communicating with your Origin Server. The below link is the Cloudflare troubleshooting guide for this error
You are trying to use an HTTP Challenge (--webroot) and you must have working HTTP access to your domain first. The Let's Debug web site is a good place to test new setups (link here).