I use CloudFlare as my DNS provider for my domain, and I learned that they provide SSL. I was confused as to how a DNS provider can provide SSL because my communications between the client and my website do not go though the DNS. I was thinking that somehow it becomes in between my website and the client, but then (besides them being able to read the packets) the communication between CloudFlare and my server would not be encrypted. How does this work? How can CloudFlare (as a DNS provider) provide SSL?
Cloudflare is not primarily a DNS provider but a Content Delivery Network (CDN). The DNS functionality is only used to make sure that Cloudflare can give an IP address of their own CDN server when a client wants to access your site. And this way the client will access the CDN server which then will access your server to get the content and serve it to the client. This means essentially that the client is not connecting to your web server but to Cloudflare web servers and thus Cloudflare can provide whatever service they want at this hostname, including HTTPS.