LetsEncrypt certificates need to be updated every 2-3 months, so won't this code fail when the certificate on the server changes? Aren't you better off trusting the root cert(s) which don't change very often?
You are right, however Let's Encrypt was free of charge, great for the demo.
Wow, this is pretty evil!
This will work fine on the bench, but will break in a few months, probably at the customers' site.
I hope no one reads this website and follows that advice.
It is not a production ready solution but rather to show how it works.